diff options
author | Guillem Jover <guillem@debian.org> | 2008-03-25 07:02:56 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2008-03-25 07:47:50 +0200 |
commit | ce0455f7c490bab2a9940f0cec1a4b1e797ddfe2 (patch) | |
tree | 3bc1a43a50b652da569cb3cd6c142b7d0576d740 /src/errors.c | |
parent | 33496645907e6cbbc79a316493ea638347595d93 (diff) | |
download | dpkg-ce0455f7c490bab2a9940f0cec1a4b1e797ddfe2.tar.gz |
Refactor status-fd duplicate output code into a new function
Based on a patch by Ian Jackson <ian@davenant.greenend.org.uk>.
Diffstat (limited to 'src/errors.c')
-rw-r--r-- | src/errors.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/errors.c b/src/errors.c index ab2c9d272..83daa0f07 100644 --- a/src/errors.c +++ b/src/errors.c @@ -56,23 +56,7 @@ void print_error_perpackage(const char *emsg, const char *arg) { fprintf(stderr, _("%s: error processing %s (--%s):\n %s\n"), DPKG, arg, cipaction->olong, emsg); - if (status_pipes) { - static struct varbuf *status= NULL; - struct pipef *pipef= status_pipes; - int r; - if (status == NULL) { - status = nfmalloc(sizeof(struct varbuf)); - varbufinit(status); - } else - varbufreset(status); - - r= varbufprintf(status, "status: %s : %s : %s\n", arg, "error",emsg); - while (pipef) { - write(pipef->fd, status->buf, r); - pipef= pipef->next; - } - } - + statusfd_send("status: %s : %s : %s", arg, "error", emsg); nr= malloc(sizeof(struct error_report)); if (!nr) { |