projects
/
platform
/
upstream
/
toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
23a66c8
)
Feeding -1 to xdup() isn't an error.
author
Rob Landley
<rob@landley.net>
Sun, 10 Jun 2012 00:49:37 +0000
(19:49 -0500)
committer
Rob Landley
<rob@landley.net>
Sun, 10 Jun 2012 00:49:37 +0000
(19:49 -0500)
lib/lib.c
patch
|
blob
|
history
diff --git
a/lib/lib.c
b/lib/lib.c
index
7af2af1
..
ec49106
100644
(file)
--- a/
lib/lib.c
+++ b/
lib/lib.c
@@
-210,8
+210,10
@@
void xclose(int fd)
int xdup(int fd)
{
- fd = dup(fd);
- if (fd == -1) perror_exit("xdup");
+ if (fd != -1) {
+ fd = dup(fd);
+ if (fd == -1) perror_exit("xdup");
+ }
return fd;
}