From: Wichert Akkerman Date: Sat, 9 Dec 2000 23:14:50 +0000 (+0000) Subject: More doogie-patches X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b6605d89706b84498c226486ce39801326c2e57;p=dpkg More doogie-patches --- diff --git a/ChangeLog b/ChangeLog index 2998942c..db253c10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Dec 10 00:10:27 CET 2000 Wichert Akkerman + + * lib/mlib.c: remove no longer used struct + * lib/mlib.c: return number of bytes read in do_fd_read + * main/enquiry.c: one more place where we cah use read_fd_vbuf + Sat Dec 09 12:21:35 CET 2000 peter karlsson * po/sv.po, doc/sv/deb.5, doc/sv/deb-old.5, doc/sv/dpkg.8: diff --git a/lib/mlib.c b/lib/mlib.c index d8a7d11e..d527cdba 100644 --- a/lib/mlib.c +++ b/lib/mlib.c @@ -124,9 +124,6 @@ void waitsubproc(pid_t pid, const char *description, int sigpipeok) { checksubprocerr(status,description,sigpipeok); } -typedef struct do_fd_copy_data { - int fd; -} do_fd_copy_data_t; typedef struct do_fd_buf_data { void *buf; int type; @@ -156,6 +153,7 @@ int read_fd_combined(int fd, void *buf, int type, int limit, char *desc, ...) { do_fd_buf_data_t data = { buf, type }; va_list al; struct varbuf v; + int ret; varbufinit(&v); @@ -163,8 +161,9 @@ int read_fd_combined(int fd, void *buf, int type, int limit, char *desc, ...) { varbufvprintf(&v, desc, al); va_end(al); - do_fd_read(fd, limit, do_fd_write_combined, &data, v.buf); + ret = do_fd_read(fd, limit, do_fd_write_combined, &data, v.buf); varbuffree(&v); + return ret; } @@ -196,4 +195,5 @@ int do_fd_read(int fd1, int limit, do_fd_write_t write_proc, void *proc_data, ch if (count<0) ohshite(_("failed in do_fd_read on read (%s)"), desc); free(buf); + return bytesread; } diff --git a/main/enquiry.c b/main/enquiry.c index a352bc00..0575ac72 100644 --- a/main/enquiry.c +++ b/main/enquiry.c @@ -697,8 +697,7 @@ void printarch(const char *const *argv) { exit(0); } close(p1[1]); - while ((c= getc(ccpipe)) != EOF) varbufaddc(&vb,c); - if (ferror(ccpipe)) ohshite(_("error reading from CC pipe")); + read_fd_vbuf(fileno(ccpipe), &vb, -1, _("error reading from CC pipe")); waitsubproc(c1,"gcc --print-libgcc-file-name",0); if (!vb.used) badlgccfn(ccompiler,"",_("empty output")); varbufaddc(&vb,0);