1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

gpg: Rename a misnomed arg in open_outfile.

* g10/openfile.c (open_outfile): Rename inp_fd to out_fd.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2018-01-28 18:59:18 +01:00
parent 660eafa3a9
commit 303310d05e
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 13 additions and 11 deletions

View File

@ -341,7 +341,7 @@ gpg_error_t generate_card_subkeypair (ctrl_t ctrl, kbnode_t pub_keyblock,
int overwrite_filep( const char *fname ); int overwrite_filep( const char *fname );
char *make_outfile_name( const char *iname ); char *make_outfile_name( const char *iname );
char *ask_outfile_name( const char *name, size_t namelen ); char *ask_outfile_name( const char *name, size_t namelen );
int open_outfile (int inp_fd, const char *iname, int mode, int open_outfile (int out_fd, const char *iname, int mode,
int restrictedperm, iobuf_t *a); int restrictedperm, iobuf_t *a);
char *get_matching_datafile (const char *sigfilename); char *get_matching_datafile (const char *sigfilename);
iobuf_t open_sigfile (const char *sigfilename, progress_filter_context_t *pfx); iobuf_t open_sigfile (const char *sigfilename, progress_filter_context_t *pfx);

View File

@ -171,32 +171,34 @@ ask_outfile_name( const char *name, size_t namelen )
* 2 = use ".sig" * 2 = use ".sig"
* 3 = use ".rev" * 3 = use ".rev"
* *
* If INP_FD is not -1 the function simply creates an IOBUF for that * With RESTRICTEDPERM a file will be created with mode 700 if
* file descriptor and ignore INAME and MODE. Note that INP_FD won't * possible.
* be closed if the returned IOBUF is closed. With RESTRICTEDPERM a *
* file will be created with mode 700 if possible. * If OUT_FD is not -1 the function simply creates an IOBUF for that
*/ * file descriptor and ignores INAME and MODE. Note that OUT_FD won't
* be closed if the returned IOBUF is closed. This is used for gpg's
* --server mode. */
int int
open_outfile (int inp_fd, const char *iname, int mode, int restrictedperm, open_outfile (int out_fd, const char *iname, int mode, int restrictedperm,
iobuf_t *a) iobuf_t *a)
{ {
int rc = 0; int rc = 0;
*a = NULL; *a = NULL;
if (inp_fd != -1) if (out_fd != -1)
{ {
char xname[64]; char xname[64];
*a = iobuf_fdopen_nc (inp_fd, "wb"); *a = iobuf_fdopen_nc (out_fd, "wb");
if (!*a) if (!*a)
{ {
rc = gpg_error_from_syserror (); rc = gpg_error_from_syserror ();
snprintf (xname, sizeof xname, "[fd %d]", inp_fd); snprintf (xname, sizeof xname, "[fd %d]", out_fd);
log_error (_("can't open '%s': %s\n"), xname, gpg_strerror (rc)); log_error (_("can't open '%s': %s\n"), xname, gpg_strerror (rc));
} }
else if (opt.verbose) else if (opt.verbose)
{ {
snprintf (xname, sizeof xname, "[fd %d]", inp_fd); snprintf (xname, sizeof xname, "[fd %d]", out_fd);
log_info (_("writing to '%s'\n"), xname); log_info (_("writing to '%s'\n"), xname);
} }
} }