summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/popen.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/popen.c')
-rw-r--r--lib/libc/gen/popen.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c
index 89aba16..0d28046 100644
--- a/lib/libc/gen/popen.c
+++ b/lib/libc/gen/popen.c
@@ -53,8 +53,8 @@ static struct pid {
struct pid *next;
FILE *fp;
pid_t pid;
-} *pidlist;
-
+} *pidlist;
+
FILE *
popen(program, type)
const char *program;
@@ -64,14 +64,14 @@ popen(program, type)
FILE *iop;
int pdes[2], pid;
- if (*type != 'r' && *type != 'w' || type[1])
+ if ( (*type != 'r' && *type != 'w') || type[1])
return (NULL);
if ((cur = malloc(sizeof(struct pid))) == NULL)
return (NULL);
if (pipe(pdes) < 0) {
- (void)free(cur);
+ free(cur);
return (NULL);
}
@@ -79,7 +79,7 @@ popen(program, type)
case -1: /* Error. */
(void)close(pdes[0]);
(void)close(pdes[1]);
- (void)free(cur);
+ free(cur);
return (NULL);
/* NOTREACHED */
case 0: /* Child. */
@@ -155,6 +155,6 @@ pclose(iop)
else
last->next = cur->next;
free(cur);
-
+
return (pid == -1 ? -1 : pstat.w_status);
}
OpenPOWER on IntegriCloud