X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=userv.git;a=blobdiff_plain;f=client.c;h=4987073a3de76dad9d9dcbe55e85ab7cb5b99a37;hp=f53211fd310a0295135bd5b1288f2cc59cf14f40;hb=b6c671fd90134d458ad4722ec3a99742bced1a34;hpb=4544c87c6355037a095e296b5280ccb3ff25ac4b diff --git a/client.c b/client.c index f53211f..4987073 100644 --- a/client.c +++ b/client.c @@ -72,6 +72,7 @@ #include "config.h" #include "common.h" +#include "both.h" #include "version.h" enum fdmodifiervalues { @@ -213,7 +214,7 @@ static void NONRETURNPRINTFFORMAT(1,2) protoerror(const char *fmt, ...) { static void xfread(void *p, size_t sz, FILE *file) { size_t nr; - nr= fread(p,1,sz,file); + nr= working_fread(p,sz,file); if (nr != sz) protoreaderror(file,"in data"); } @@ -277,7 +278,8 @@ static void getprogress(struct progress_msg *progress_r, FILE *file) { protoerror("stderr message length %d is far too long", progress_r->data.errmsg.messagelen); for (i=0; idata.errmsg.messagelen; i++) { - c= getc(file); if (c==EOF) protoreaderror(file,"in error message"); + c= working_getc(file); + if (c==EOF) protoreaderror(file,"in error message"); if (isprint(c)) putc(c,stderr); else fprintf(stderr,"\\x%02x",(unsigned char)c); } @@ -370,6 +372,7 @@ static void sighandler_chld(int ignored) /* DOES return, unlike in daemon */ { if (child == 0 || (child == -1 && errno == ECHILD)) break; if (child == -1) syscallerror("wait for child process (in sigchld handler)"); for (fd=0; fd=fdsetupsize) continue; /* perhaps the caller gave us children */ if ((WIFEXITED(status) && WEXITSTATUS(status)==0) || (WIFSIGNALED(status) && WTERMSIG(status)==SIGPIPE) || @@ -738,13 +741,14 @@ static void callvalueoption(const struct optioninfo *oip, char *arg) { char *equals; if (oip->values == 2) { equals= strchr(arg,'='); - if (!equals) + if (!equals) { if (oip->abbrev) usageerror("option --%s (-%c) passed argument `%s' with no `='", oip->full,oip->abbrev,arg); else usageerror("option --%s passed argument `%s' with no `='", oip->full,arg); + } *equals++= 0; (oip->fn)(oip,equals,arg); } else { @@ -1129,6 +1133,7 @@ static void connect_pipes(void) { struct sigaction sig; char catnamebuf[sizeof(int)*3+30]; int fd, reading; + pid_t child; for (fd=0; fd