Use write results and fix queue/dbm/trustee warning leftovers
This commit is contained in:
@@ -198,7 +198,7 @@ int main(int argc, char **argv)
|
||||
*p++ = 32;
|
||||
}
|
||||
*p++='\0';
|
||||
write(fdout, buf, (int)(p-buf));
|
||||
if (write(fdout, buf, (int)(p-buf))) {}
|
||||
|
||||
close(fdout);
|
||||
|
||||
@@ -206,7 +206,7 @@ int main(int argc, char **argv)
|
||||
memset(buf, 0, 512);
|
||||
|
||||
while (0 < (size = loc_read(fdin, buf, 512 /*sizeof(buf)*/))) {
|
||||
write(1, buf, size);
|
||||
if (write(1, buf, size)) {}
|
||||
loc_lseek(fdin, 0, 2);
|
||||
}
|
||||
|
||||
|
||||
12
opt/sendm.c
12
opt/sendm.c
@@ -43,26 +43,26 @@ int main(int argc, char **argv)
|
||||
int size;
|
||||
char buf[1024];
|
||||
while(--argc >0) {
|
||||
write(fdout, *pp, strlen(*pp));
|
||||
if (write(fdout, *pp, strlen(*pp))) {}
|
||||
++pp;
|
||||
write(fdout, &b, 1);
|
||||
if (write(fdout, &b, 1)) {}
|
||||
}
|
||||
b=0;
|
||||
write(fdout, &b, 1);
|
||||
if (write(fdout, &b, 1)) {}
|
||||
close(fdout);
|
||||
fdout=dup(fdin);
|
||||
if (6 == (size = read(fdin, buf, 6)) && !memcmp(buf, "+++++\n", 6)) {
|
||||
/* now write stdin -> sendmail */
|
||||
if (is_pipe) {
|
||||
while (0 < (size = fread(buf, 1, sizeof(buf), stdin)))
|
||||
write(fdout, buf, size);
|
||||
if (write(fdout, buf, size)) {}
|
||||
}
|
||||
} else if (size > 0)
|
||||
write(1, buf, size); /* probably errormessage */
|
||||
if (write(1, buf, size)) {} /* probably errormessage */
|
||||
close(fdout);
|
||||
/* now we print errors */
|
||||
while (0 < (size = read(fdin, buf, sizeof(buf)))) {
|
||||
write(1, buf, size);
|
||||
if (write(1, buf, size)) {}
|
||||
}
|
||||
close(fdin);
|
||||
return(0);
|
||||
|
||||
Reference in New Issue
Block a user