X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/78290c874170b39a1f87d1dcbd80d03fa6a6ab05..01fd4094faf9fa892faad3621433e5faa98157f9:/uip/slocal.c diff --git a/uip/slocal.c b/uip/slocal.c index bd751a1f..6027eabd 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -27,8 +27,8 @@ #include #include #include -#include "../sbr/lock_file.h" -#include "../sbr/m_mktemp.h" +#include "sbr/lock_file.h" +#include "sbr/m_mktemp.h" #include #include @@ -636,7 +636,7 @@ usr_delivery (int fd, char *delivery, int su) } fclose (fp); - return (won ? 0 : -1); + return won ? 0 : -1; } @@ -1046,7 +1046,7 @@ usr_pipe (int fd_arg, char *cmd, char *pgm, char **vec, int suppress) { volatile int fd = fd_arg; pid_t child_id; - int i, bytes, seconds, status; + int bytes, seconds, status; struct stat st; if (verbose && !suppress) @@ -1054,9 +1054,7 @@ usr_pipe (int fd_arg, char *cmd, char *pgm, char **vec, int suppress) lseek(fd, 0, SEEK_SET); - for (i = 0; (child_id = fork()) == -1 && i < 5; i++) - sleep (5); - + child_id = fork(); switch (child_id) { case -1: /* fork error */ @@ -1123,7 +1121,7 @@ usr_pipe (int fd_arg, char *cmd, char *pgm, char **vec, int suppress) else pidstatus (status, stdout, ", failed"); } - return (status == 0 ? 0 : -1); + return status == 0 ? 0 : -1; } /* * Ruthlessly kill the child and anything @@ -1295,7 +1293,7 @@ fputs_error: static char * trim (char *cp) { - char buffer[BUFSIZ*4]; + static char buffer[BUFSIZ * 4]; char *bp, *sp; if (cp == NULL) @@ -1322,8 +1320,7 @@ trim (char *cp) if (isspace((unsigned char) *sp)) *sp = ' '; - /* now return a copy */ - return mh_xstrdup(bp); + return bp; } /*