=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mail/popen.c,v retrieving revision 1.6 retrieving revision 1.7 diff -c -r1.6 -r1.7 *** src/usr.bin/mail/popen.c 1997/07/13 21:21:15 1.6 --- src/usr.bin/mail/popen.c 1997/07/13 23:54:01 1.7 *************** *** 1,4 **** ! /* $OpenBSD: popen.c,v 1.6 1997/07/13 21:21:15 millert Exp $ */ /* $NetBSD: popen.c,v 1.6 1997/05/13 06:48:42 mikel Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: popen.c,v 1.7 1997/07/13 23:54:01 millert Exp $ */ /* $NetBSD: popen.c,v 1.6 1997/05/13 06:48:42 mikel Exp $ */ /* *************** *** 38,44 **** #if 0 static char sccsid[] = "@(#)popen.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: popen.c,v 1.6 1997/07/13 21:21:15 millert Exp $"; #endif #endif /* not lint */ --- 38,44 ---- #if 0 static char sccsid[] = "@(#)popen.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: popen.c,v 1.7 1997/07/13 23:54:01 millert Exp $"; #endif #endif /* not lint */ *************** *** 79,85 **** if ((fp = fopen(file, mode)) != NULL) { register_file(fp, 0, 0); ! (void) fcntl(fileno(fp), F_SETFD, 1); } return(fp); } --- 79,85 ---- if ((fp = fopen(file, mode)) != NULL) { register_file(fp, 0, 0); ! (void)fcntl(fileno(fp), F_SETFD, 1); } return(fp); } *************** *** 93,99 **** if ((fp = fdopen(fd, mode)) != NULL) { register_file(fp, 0, 0); ! (void) fcntl(fileno(fp), F_SETFD, 1); } return(fp); } --- 93,99 ---- if ((fp = fdopen(fd, mode)) != NULL) { register_file(fp, 0, 0); ! (void)fcntl(fileno(fp), F_SETFD, 1); } return(fp); } *************** *** 119,126 **** if (pipe(p) < 0) return(NULL); ! (void) fcntl(p[READ], F_SETFD, 1); ! (void) fcntl(p[WRITE], F_SETFD, 1); if (*mode == 'r') { myside = p[READ]; fd0 = -1; --- 119,126 ---- if (pipe(p) < 0) return(NULL); ! (void)fcntl(p[READ], F_SETFD, 1); ! (void)fcntl(p[WRITE], F_SETFD, 1); if (*mode == 'r') { myside = p[READ]; fd0 = -1; *************** *** 179,185 **** { struct fp *fpp; ! if ((fpp = (struct fp *) malloc(sizeof(*fpp))) == NULL) panic("Out of memory"); fpp->fp = fp; fpp->pipe = pipe; --- 179,185 ---- { struct fp *fpp; ! if ((fpp = (struct fp *)malloc(sizeof(*fpp))) == NULL) panic("Out of memory"); fpp->fp = fp; fpp->pipe = pipe; *************** *** 197,203 **** for (pp = &fp_head; (p = *pp) != NULL; pp = &p->link) if (p->fp == fp) { *pp = p->link; ! free((char *) p); return; } panic("Invalid file pointer"); --- 197,203 ---- for (pp = &fp_head; (p = *pp) != NULL; pp = &p->link) if (p->fp == fp) { *pp = p->link; ! (void)free(p); return; } panic("Invalid file pointer"); *************** *** 289,300 **** if (nset != NULL) { for (i = 1; i < NSIG; i++) if (sigismember(nset, i)) ! (void) signal(i, SIG_IGN); } if (nset == NULL || !sigismember(nset, SIGINT)) ! (void) signal(SIGINT, SIG_DFL); sigfillset(&fset); ! (void) sigprocmask(SIG_UNBLOCK, &fset, NULL); } int --- 289,300 ---- if (nset != NULL) { for (i = 1; i < NSIG; i++) if (sigismember(nset, i)) ! (void)signal(i, SIG_IGN); } if (nset == NULL || !sigismember(nset, SIGINT)) ! (void)signal(SIGINT, SIG_DFL); sigfillset(&fset); ! (void)sigprocmask(SIG_UNBLOCK, &fset, NULL); } int *************** *** 319,325 **** cpp = &(*cpp)->link) ; if (*cpp == NULL) { ! *cpp = (struct child *) malloc(sizeof(struct child)); (*cpp)->pid = pid; (*cpp)->done = (*cpp)->free = 0; (*cpp)->link = NULL; --- 319,325 ---- cpp = &(*cpp)->link) ; if (*cpp == NULL) { ! *cpp = (struct child *)malloc(sizeof(struct child)); (*cpp)->pid = pid; (*cpp)->done = (*cpp)->free = 0; (*cpp)->link = NULL; *************** *** 336,342 **** for (cpp = &child; *cpp != cp; cpp = &(*cpp)->link) ; *cpp = cp->link; ! free((char *) cp); } void --- 336,342 ---- for (cpp = &child; *cpp != cp; cpp = &(*cpp)->link) ; *cpp = cp->link; ! (void)free(cp); } void *************** *** 426,442 **** lockfp = NULL; } else if (action == 1) { /* Create the lock */ ! if ((cmd = (char *) malloc(sizeof(_PATH_MAIL_LOCAL) + 3)) == NULL) panic("Out of memory"); sprintf(cmd, "%s -H", _PATH_MAIL_LOCAL); if ((lockfp = Popen(cmd, "r")) == NULL || getc(lockfp) != '1') { lockfp = NULL; ! free(cmd); return(0); } lock_pid = fp_head->pid; /* new entries added at head */ ! free(cmd); } else { fprintf(stderr, "handle_spool_locks: unknown action %d\n", action); --- 426,442 ---- lockfp = NULL; } else if (action == 1) { /* Create the lock */ ! if ((cmd = (char *)malloc(sizeof(_PATH_MAIL_LOCAL) + 3)) == NULL) panic("Out of memory"); sprintf(cmd, "%s -H", _PATH_MAIL_LOCAL); if ((lockfp = Popen(cmd, "r")) == NULL || getc(lockfp) != '1') { lockfp = NULL; ! (void)free(cmd); return(0); } lock_pid = fp_head->pid; /* new entries added at head */ ! (void)free(cmd); } else { fprintf(stderr, "handle_spool_locks: unknown action %d\n", action);