git.samba.org
/
socket_wrapper.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c03935
)
src: Handle stale fds in dup() and dup2().
author
Andreas Schneider
<asn@samba.org>
Tue, 28 Jan 2014 13:10:53 +0000
(14:10 +0100)
committer
Andreas Schneider
<asn@samba.org>
Tue, 28 Jan 2014 13:11:51 +0000
(14:11 +0100)
Reviewed-by: Stefan Metzmacher <metze@samba.org>
src/socket_wrapper.c
patch
|
blob
|
history
diff --git
a/src/socket_wrapper.c
b/src/socket_wrapper.c
index 0d74321f03a40f56f45bf254ad91bcae280ef3ec..353a9a5bd2d943a7ffe18a51d268295d5e6dfd65 100644
(file)
--- a/
src/socket_wrapper.c
+++ b/
src/socket_wrapper.c
@@
-3934,6
+3934,9
@@
static int swrap_dup(int fd)
return -1;
}
+ /* Make sure we don't have an entry for the fd */
+ swrap_remove_stale(fi->fd);
+
SWRAP_DLIST_ADD(si->fds, fi);
return fi->fd;
}
@@
-3978,6
+3981,9
@@
static int swrap_dup2(int fd, int newfd)
return -1;
}
+ /* Make sure we don't have an entry for the fd */
+ swrap_remove_stale(fi->fd);
+
SWRAP_DLIST_ADD(si->fds, fi);
return fi->fd;
}