diff options
| author | Werner Koch <[email protected]> | 2010-03-08 18:19:21 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2010-03-08 18:19:21 +0000 |
| commit | 6216d33e8cc1c2d01533b3e9b97dc7009b4f3553 (patch) | |
| tree | 062bf701637025088b83a9e8684aa7a1eae68fb5 /sm/gpgsm.c | |
| parent | Use macros for iobuf ioctls. (diff) | |
| download | gnupg-6216d33e8cc1c2d01533b3e9b97dc7009b4f3553.tar.gz gnupg-6216d33e8cc1c2d01533b3e9b97dc7009b4f3553.zip | |
Removed almost al dup calls.
Diffstat (limited to 'sm/gpgsm.c')
| -rw-r--r-- | sm/gpgsm.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sm/gpgsm.c b/sm/gpgsm.c index 8a8c017d9..39de29181 100644 --- a/sm/gpgsm.c +++ b/sm/gpgsm.c @@ -1829,7 +1829,7 @@ main ( int argc, char **argv) case aKeygen: /* Generate a key; well kind of. */ { estream_t fpin = NULL; - FILE *fpout; + estream_t fpout; if (opt.batch) { @@ -1841,15 +1841,14 @@ main ( int argc, char **argv) wrong_args ("--gen-key --batch [parmfile]"); } - fpout = open_fwrite (opt.outfile?opt.outfile:"-"); + fpout = open_es_fwrite (opt.outfile?opt.outfile:"-"); if (fpin) gpgsm_genkey (&ctrl, fpin, fpout); else gpgsm_gencertreq_tty (&ctrl, fpout); - if (fpout != stdout) - fclose (fpout); + es_fclose (fpout); } break; @@ -1860,14 +1859,14 @@ main ( int argc, char **argv) case aExport: { - FILE *fp = open_fwrite (opt.outfile?opt.outfile:"-"); + estream_t fp; + fp = open_es_fwrite (opt.outfile?opt.outfile:"-"); for (sl=NULL; argc; argc--, argv++) add_to_strlist (&sl, *argv); - gpgsm_export (&ctrl, sl, fp, NULL); + gpgsm_export (&ctrl, sl, fp); free_strlist(sl); - if (fp != stdout) - fclose (fp); + es_fclose (fp); } break; |
