projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f4dd6e3
)
Don't close file descriptors when we are duplicating them.
author
Matt Kraai
<kraai@debian.org>
Tue, 5 Jun 2001 16:50:08 +0000
(16:50 -0000)
committer
Matt Kraai
<kraai@debian.org>
Tue, 5 Jun 2001 16:50:08 +0000
(16:50 -0000)
hush.c
patch
|
blob
|
history
shell/hush.c
patch
|
blob
|
history
diff --git
a/hush.c
b/hush.c
index 372c95753198018f7a7e51b84740df40a15b1c4b..a58da189cabdbcdcbe7a49acd072a00ea70b4abb 100644
(file)
--- a/
hush.c
+++ b/
hush.c
@@
-1018,7
+1018,8
@@
static int setup_redirects(struct child_prog *prog, int squirrel[])
close(openfd);
} else {
dup2(openfd, redir->fd);
- close(openfd);
+ if (redir->dup == -1)
+ close (openfd);
}
}
}
diff --git
a/shell/hush.c
b/shell/hush.c
index 372c95753198018f7a7e51b84740df40a15b1c4b..a58da189cabdbcdcbe7a49acd072a00ea70b4abb 100644
(file)
--- a/
shell/hush.c
+++ b/
shell/hush.c
@@
-1018,7
+1018,8
@@
static int setup_redirects(struct child_prog *prog, int squirrel[])
close(openfd);
} else {
dup2(openfd, redir->fd);
- close(openfd);
+ if (redir->dup == -1)
+ close (openfd);
}
}
}