X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/3b6170b27ba8fedbb4d67d2842bfaa38d4417962..4b846eff7deb83d1019868cabf7f794651502432:/uip/slocal.c diff --git a/uip/slocal.c b/uip/slocal.c index 723cb27a..dae9ca95 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -26,6 +26,7 @@ #include #include #include +#include "h/done.h" #include #include "sbr/lock_file.h" #include "sbr/m_mktemp.h" @@ -636,7 +637,7 @@ usr_delivery (int fd, char *delivery, int su) } fclose (fp); - return (won ? 0 : -1); + return won ? 0 : -1; } @@ -802,12 +803,12 @@ parse (int fd) p->p_value = getcpy (q ? q->p_value : ""); p->p_flags &= ~P_CHK; if (debug) - debug_printf ("vars[%ld]: name=\"%s\" value=\"%s\"\n", - p - vars, p->p_name, trim(p->p_value)); + debug_printf ("vars[%td]: name=\"%s\" value=\"%s\"\n", + p - vars, p->p_name, trim(p->p_value)); } if (debug) { for (p = hdrs; p->p_name; p++) - debug_printf ("hdrs[%ld]: name=\"%s\" value=\"%s\"\n", + debug_printf ("hdrs[%td]: name=\"%s\" value=\"%s\"\n", p - hdrs, p->p_name, p->p_value ? trim(p->p_value) : ""); } @@ -887,7 +888,7 @@ glob (int fd) if (debug) { for (p = vars; p->p_name; p++) - debug_printf ("vars[%ld]: name=\"%s\" value=\"%s\"\n", + debug_printf ("vars[%td]: name=\"%s\" value=\"%s\"\n", p - vars, p->p_name, trim(p->p_value)); } } @@ -931,13 +932,13 @@ logged_in (void) if (debug) continue; endutxent(); - return (utmped = DONE); + return utmped = DONE; } } endutxent(); #endif /* HAVE_GETUTXENT */ - return (utmped = NOTOK); + return utmped = NOTOK; } #define check(t,a,b) if (t < a || t > b) return -1 @@ -1091,7 +1092,7 @@ usr_pipe (int fd_arg, char *cmd, char *pgm, char **vec, int suppress) setenv("SHELL", pw->pw_shell, 1); execvp (pgm, vec); - _exit (-1); + _exit(1); default: /* parent process */ @@ -1121,7 +1122,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 @@ -1293,7 +1294,7 @@ fputs_error: static char * trim (char *cp) { - char buffer[BUFSIZ*4]; + static char buffer[BUFSIZ * 4]; char *bp, *sp; if (cp == NULL) @@ -1320,8 +1321,7 @@ trim (char *cp) if (isspace((unsigned char) *sp)) *sp = ' '; - /* now return a copy */ - return mh_xstrdup(bp); + return bp; } /*