]> diplodocus.org Git - nmh/blobdiff - uip/slocal.c
mime_type.c: Fix regexp in comment that describes following code.
[nmh] / uip / slocal.c
index bd751a1f5c0880574f462340a88baf9f13a7359d..6027eabd7792894b1aacdbea86c9a666b803bbd2 100644 (file)
@@ -27,8 +27,8 @@
 #include <h/tws.h>
 #include <h/mts.h>
 #include <h/utils.h>
-#include "../sbr/lock_file.h"
-#include "../sbr/m_mktemp.h"
+#include "sbr/lock_file.h"
+#include "sbr/m_mktemp.h"
 
 #include <pwd.h>
 #include <sys/ioctl.h>
@@ -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;
 }
 
 /*