From 1118857d92056b587950ea62feec07c4dde63e42 Mon Sep 17 00:00:00 2001 From: Jules Colding Date: Tue, 29 May 2007 09:06:58 +0000 Subject: Fix file descriptor leaks svn path=/trunk/; revision=33598 --- shell/ChangeLog | 4 ++++ shell/main.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'shell') 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 + + * main.c (main): Prevent dup2() and close() on -1 + 2007-05-13 Matthew Barnes * 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); -- cgit v1.2.3