projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b743a6e
)
do not leak nullfd
author
Christian Grothoff
<christian@grothoff.org>
Sat, 14 Aug 2010 21:36:08 +0000
(21:36 +0000)
committer
Christian Grothoff
<christian@grothoff.org>
Sat, 14 Aug 2010 21:36:08 +0000
(21:36 +0000)
src/util/service.c
patch
|
blob
|
history
diff --git
a/src/util/service.c
b/src/util/service.c
index 21841dd49c6ad2d79fc89f302c75e81b0113e535..df5342c1dca496161ab58e60231ebfd09fa9c974 100644
(file)
--- a/
src/util/service.c
+++ b/
src/util/service.c
@@
-1415,10
+1415,12
@@
detach_terminal (struct GNUNET_SERVICE_Context *sctx)
return GNUNET_SYSERR;
/* set stdin/stdout to /dev/null */
if ((dup2 (nullfd, 0) < 0) || (dup2 (nullfd, 1) < 0))
- {
+ {
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "dup2");
+ (void) CLOSE (nullfd);
return GNUNET_SYSERR;
}
+ (void) CLOSE (nullfd);
/* Detach from controlling terminal */
pid = setsid ();
if (pid == -1)