summaryrefslogtreecommitdiffstats
path: root/newlib/libc/posix/popen.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/posix/popen.c')
-rw-r--r--newlib/libc/posix/popen.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/newlib/libc/posix/popen.c b/newlib/libc/posix/popen.c
index 38978c7aa..faf72b6e3 100644
--- a/newlib/libc/posix/popen.c
+++ b/newlib/libc/posix/popen.c
@@ -113,7 +113,7 @@ _DEFUN(popen, (program, type),
const char *program _AND
const char *type)
{
- struct pid *cur, *last;
+ struct pid *cur;
FILE *iop;
int pdes[2], pid;
@@ -159,8 +159,7 @@ _DEFUN(popen, (program, type),
(void)close(pdes[1]);
}
/* Close all fd's created by prior popen. */
- for (last = NULL, cur = pidlist; cur;
- last = cur, cur = cur->next)
+ for (cur = pidlist; cur; cur = cur->next)
(void)close (fileno (cur->fp));
execl(_PATH_BSHELL, "sh", "-c", program, NULL);
_exit(127);