aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-gpg-context.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-12-02 06:51:58 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-12-02 06:51:58 +0800
commit9d8f9dea7be5a8d8973198eb5367d9f055f74974 (patch)
treeff9d7843085dca33af57f8d2f6d22684fae4906f /camel/camel-gpg-context.c
parent7a7855e2879922b371597b25c27fd97d79dd165a (diff)
downloadgsoc2013-evolution-9d8f9dea7be5a8d8973198eb5367d9f055f74974.tar.gz
gsoc2013-evolution-9d8f9dea7be5a8d8973198eb5367d9f055f74974.tar.zst
gsoc2013-evolution-9d8f9dea7be5a8d8973198eb5367d9f055f74974.zip
Start at fd = 3.
2003-12-01 Jeffrey Stedfast <fejj@ximian.com> * camel-process.c (camel_process_fork): Start at fd = 3. * camel-gpg-context.c (gpg_ctx_op_start): Same. * camel-filter-driver.c (pipe_to_system): Same. * camel-filter-search.c (run_command): Start at fd = 3. svn path=/trunk/; revision=23549
Diffstat (limited to 'camel/camel-gpg-context.c')
-rw-r--r--camel/camel-gpg-context.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c
index ee9bc4f5d3..4b7f39dd7e 100644
--- a/camel/camel-gpg-context.c
+++ b/camel/camel-gpg-context.c
@@ -581,16 +581,11 @@ gpg_ctx_op_start (struct _GpgCtx *gpg)
setsid ();
maxfd = sysconf (_SC_OPEN_MAX);
- if (maxfd > 0) {
- /* Loop over all fds. */
- for (i = 0; i < maxfd; i++) {
- if ((i != STDIN_FILENO) &&
- (i != STDOUT_FILENO) &&
- (i != STDERR_FILENO) &&
- (i != fds[7]) && /* status fd */
- (i != fds[8])) /* passwd fd */
- fcntl (i, F_SETFD, FD_CLOEXEC);
- }
+ /* Loop over all fds. */
+ for (i = 3; i < maxfd; i++) {
+ /* don't close the status-fd or passwd-fd */
+ if (i != fds[7] && i != fds[8])
+ fcntl (i, F_SETFD, FD_CLOEXEC);
}
/* run gpg */