diff options
author | Jules Colding <jcolding@src.gnome.org> | 2007-05-29 17:06:58 +0800 |
---|---|---|
committer | Jules Colding <jcolding@src.gnome.org> | 2007-05-29 17:06:58 +0800 |
commit | 1118857d92056b587950ea62feec07c4dde63e42 (patch) | |
tree | 0533f108b4291e46a7faf91c7df578d1f49c1ace /shell | |
parent | d867b114fa56ed518b41bcdf2e6affe980e0ae10 (diff) | |
download | gsoc2013-evolution-1118857d92056b587950ea62feec07c4dde63e42.tar.gz gsoc2013-evolution-1118857d92056b587950ea62feec07c4dde63e42.tar.zst gsoc2013-evolution-1118857d92056b587950ea62feec07c4dde63e42.zip |
Fix file descriptor leaks
svn path=/trunk/; revision=33598
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 4 | ||||
-rw-r--r-- | shell/main.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 6ce4fdc8b1..4f852dff4b 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,7 @@ +2007-05-28 Jules Colding <colding@omesc.com> + + * main.c (main): Prevent dup2() and close() on -1 + 2007-05-13 Matthew Barnes <mbarnes@redhat.com> * e-shell.c (impl_Shell_handleURI): diff --git a/shell/main.c b/shell/main.c index 0ecdff13b5..9667b862f8 100644 --- a/shell/main.c +++ b/shell/main.c @@ -541,7 +541,7 @@ main (int argc, char **argv) int fd; fd = g_open (evolution_debug_log, O_WRONLY | O_CREAT | O_TRUNC, 0600); - if (fd) { + if (fd != -1) { dup2 (fd, STDOUT_FILENO); dup2 (fd, STDERR_FILENO); close (fd); |