diff options
author | Werner Koch <wk@gnupg.org> | 2010-06-07 15:33:02 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2010-06-07 15:33:02 +0200 |
commit | bbe388b5db35be6ffece8ebd42f11372af016763 (patch) | |
tree | 73e1fe9697b969be66bd89953125010e5721efe1 /common/exechelp-posix.c | |
parent | Print --version etc via estream (diff) | |
download | gnupg2-bbe388b5db35be6ffece8ebd42f11372af016763.tar.xz gnupg2-bbe388b5db35be6ffece8ebd42f11372af016763.zip |
Add unfinished gpgtar.
Collected changes and ports of bug fixes from stable.
Diffstat (limited to 'common/exechelp-posix.c')
-rw-r--r-- | common/exechelp-posix.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/common/exechelp-posix.c b/common/exechelp-posix.c index aaf628715..1f4cca6c8 100644 --- a/common/exechelp-posix.c +++ b/common/exechelp-posix.c @@ -313,11 +313,22 @@ gnupg_spawn_process (const char *pgmname, const char *argv[], *statusfile = NULL; *pid = (pid_t)(-1); - es_fflush (infile); - es_rewind (infile); - fd = es_fileno (infile); - fdout = es_fileno (outfile); - if (fd == -1 || fdout == -1) + + if (infile) + { + es_fflush (infile); + es_rewind (infile); + fd = es_fileno (infile); + } + else + fd = -1; + + if (outfile) + fdout = es_fileno (outfile); + else + fdout = -1; + + if ((infile && fd == -1) || (outfile && fdout == -1)) log_fatal ("no file descriptor for file passed to gnupg_spawn_process\n"); if (pipe (rp) == -1) |