1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00
This commit is contained in:
Werner Koch 2010-08-23 16:27:10 +00:00
parent 299cb641e6
commit 1803af7a1c
4 changed files with 15 additions and 6 deletions

View file

@ -1,3 +1,10 @@
2010-08-23 Werner Koch <wk@g10code.com>
* gpgconf-comp.c (retrieve_options_from_program)
(retrieve_options_from_file, copy_file): Do not use ferror after a
failed fclose. Note that the stream is in any case invalid after
calling fclose and that fclose does set ERRNO.
2010-08-19 Werner Koch <wk@g10code.com>
* gpgconf.c (main): Fix --check-options.

View file

@ -1903,7 +1903,7 @@ retrieve_options_from_program (gc_component_t component, gc_backend_t backend)
}
if (length < 0 || ferror (config))
gc_error (1, errno, "error reading from %s",pgmname);
if (fclose (config) && ferror (config))
if (fclose (config))
gc_error (1, errno, "error closing %s", pgmname);
err = gnupg_wait_process (pgmname, pid, &exitcode);
@ -2004,7 +2004,7 @@ retrieve_options_from_program (gc_component_t component, gc_backend_t backend)
if (length < 0 || ferror (config))
gc_error (1, errno, "error reading from %s", config_filename);
if (fclose (config) && ferror (config))
if (fclose (config))
gc_error (1, errno, "error closing %s", config_filename);
}
@ -2084,7 +2084,7 @@ retrieve_options_from_file (gc_component_t component, gc_backend_t backend)
if (config_option->flags & GC_OPT_FLAG_NO_CHANGE)
list_option->flags |= GC_OPT_FLAG_NO_CHANGE;
if (list_file && fclose (list_file) && ferror (list_file))
if (list_file && fclose (list_file))
gc_error (1, errno, "error closing %s", list_filename);
xfree (line);
}
@ -2305,9 +2305,9 @@ copy_file (const char *src_name, const char *dst_name)
return -1;
}
if (fclose (dst) && ferror (dst))
if (fclose (dst))
gc_error (1, errno, "error closing %s", dst_name);
if (fclose (src) && ferror (src))
if (fclose (src))
gc_error (1, errno, "error closing %s", src_name);
return 0;