diff options
Diffstat (limited to 'usr.bin/mail/popen.c')
-rw-r--r-- | usr.bin/mail/popen.c | 69 |
1 files changed, 20 insertions, 49 deletions
diff --git a/usr.bin/mail/popen.c b/usr.bin/mail/popen.c index b6dc30a..18bf7e5 100644 --- a/usr.bin/mail/popen.c +++ b/usr.bin/mail/popen.c @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -68,8 +64,7 @@ static void delchild(struct child *); static int file_pid(FILE *); FILE * -Fopen(path, mode) - const char *path, *mode; +Fopen(const char *path, const char *mode) { FILE *fp; @@ -81,9 +76,7 @@ Fopen(path, mode) } FILE * -Fdopen(fd, mode) - int fd; - const char *mode; +Fdopen(int fd, const char *mode) { FILE *fp; @@ -95,17 +88,14 @@ Fdopen(fd, mode) } int -Fclose(fp) - FILE *fp; +Fclose(FILE *fp) { unregister_file(fp); return (fclose(fp)); } FILE * -Popen(cmd, mode) - char *cmd; - const char *mode; +Popen(char *cmd, const char *mode) { int p[2]; int myside, hisside, fd0, fd1; @@ -139,8 +129,7 @@ Popen(cmd, mode) } int -Pclose(ptr) - FILE *ptr; +Pclose(FILE *ptr) { int i; sigset_t nset, oset; @@ -158,7 +147,7 @@ Pclose(ptr) } void -close_all_files() +close_all_files(void) { while (fp_head != NULL) @@ -169,9 +158,7 @@ close_all_files() } void -register_file(fp, pipe, pid) - FILE *fp; - int pipe, pid; +register_file(FILE *fp, int pipe, int pid) { struct fp *fpp; @@ -185,8 +172,7 @@ register_file(fp, pipe, pid) } void -unregister_file(fp) - FILE *fp; +unregister_file(FILE *fp) { struct fp **pp, *p; @@ -201,8 +187,7 @@ unregister_file(fp) } int -file_pid(fp) - FILE *fp; +file_pid(FILE *fp) { struct fp *p; @@ -222,11 +207,8 @@ file_pid(fp) */ /*VARARGS4*/ int -run_command(cmd, mask, infd, outfd, a0, a1, a2) - char *cmd; - sigset_t *mask; - int infd, outfd; - char *a0, *a1, *a2; +run_command(char *cmd, sigset_t *mask, int infd, int outfd, char *a0, + char *a1, char *a2) { int pid; @@ -237,11 +219,8 @@ run_command(cmd, mask, infd, outfd, a0, a1, a2) /*VARARGS4*/ int -start_command(cmd, mask, infd, outfd, a0, a1, a2) - char *cmd; - sigset_t *mask; - int infd, outfd; - char *a0, *a1, *a2; +start_command(char *cmd, sigset_t *mask, int infd, int outfd, char *a0, + char *a1, char *a2) { int pid; @@ -266,9 +245,7 @@ start_command(cmd, mask, infd, outfd, a0, a1, a2) } void -prepare_child(nset, infd, outfd) - sigset_t *nset; - int infd, outfd; +prepare_child(sigset_t *nset, int infd, int outfd) { int i; sigset_t eset; @@ -291,8 +268,7 @@ prepare_child(nset, infd, outfd) } int -wait_command(pid) - int pid; +wait_command(int pid) { if (wait_child(pid) < 0) { @@ -303,8 +279,7 @@ wait_command(pid) } static struct child * -findchild(pid) - int pid; +findchild(int pid) { struct child **cpp; @@ -323,8 +298,7 @@ findchild(pid) } static void -delchild(cp) - struct child *cp; +delchild(struct child *cp) { struct child **cpp; @@ -336,8 +310,7 @@ delchild(cp) /*ARGSUSED*/ void -sigchild(signo) - int signo; +sigchild(int signo __unused) { int pid; int status; @@ -360,8 +333,7 @@ int wait_status; * Wait for a specific child to die. */ int -wait_child(pid) - int pid; +wait_child(int pid) { sigset_t nset, oset; struct child *cp = findchild(pid); @@ -382,8 +354,7 @@ wait_child(pid) * Mark a child as don't care. */ void -free_child(pid) - int pid; +free_child(int pid) { sigset_t nset, oset; struct child *cp = findchild(pid); |