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 /g10/openfile.c | |
parent | Use macros for iobuf ioctls. (diff) | |
download | gnupg-6216d33e8cc1c2d01533b3e9b97dc7009b4f3553.tar.gz gnupg-6216d33e8cc1c2d01533b3e9b97dc7009b4f3553.zip |
Removed almost al dup calls.
Diffstat (limited to 'g10/openfile.c')
-rw-r--r-- | g10/openfile.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/g10/openfile.c b/g10/openfile.c index 4b7fe3600..b1cd294c1 100644 --- a/g10/openfile.c +++ b/g10/openfile.c @@ -1,6 +1,6 @@ /* openfile.c - * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, - * 2005, 2009 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2009, + * 2010 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -192,13 +192,8 @@ open_outfile (int inp_fd, const char *iname, int mode, iobuf_t *a) if (inp_fd != -1) { char xname[64]; - int fd2; - fd2 = dup (inp_fd); - if (fd2 == -1) - *a = NULL; - else - *a = iobuf_fdopen (fd2, "wb"); + *a = iobuf_fdopen_nc (inp_fd, "wb"); if (!*a) { rc = gpg_error_from_syserror (); |