projects
/
monkeysphere.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cdc4ff1
)
cleaning up failed pipes properly, flushing error output to ensure it gets printed...
author
Daniel Kahn Gillmor
<dkg@fifthhorseman.net>
Wed, 9 Apr 2008 15:59:48 +0000
(11:59 -0400)
committer
Daniel Kahn Gillmor
<dkg@fifthhorseman.net>
Wed, 9 Apr 2008 15:59:48 +0000
(11:59 -0400)
gnutls-helpers.c
patch
|
blob
|
history
diff --git
a/gnutls-helpers.c
b/gnutls-helpers.c
index 50b611446a32145c12edb5ba91bc149a93968705..5a567e2940ef9376f35a535382f31107e0b0e640 100644
(file)
--- a/
gnutls-helpers.c
+++ b/
gnutls-helpers.c
@@
-20,6
+20,7
@@
void err(const char* fmt, ...) {
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
+ fflush(stderr);
}
void logfunc(int level, const char* string) {
@@
-286,6
+287,10
@@
int create_writing_pipe(pid_t* pid, const char* path, char* const argv[]) {
}
execv(path, argv);
err("exec %s failed (error: %d \"%s\")\n", path, errno, strerror(errno));
+ /* close the open file descriptors */
+ close(p[0]);
+ close(0);
+
exit(1);
} else { /* this is the parent */
close(p[0]); /* close unused read end */