chiark / gitweb /
tools: Improve error handling.
authorJustus Winter <justus@g10code.com>
Mon, 23 Jan 2017 13:24:22 +0000 (14:24 +0100)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 18 Sep 2017 20:41:12 +0000 (21:41 +0100)
* tools/gpgconf-comp.c (gp_component_change_options): Improve error
handling when reading from stdin.
--
Previously, errors encountered while reading the configuration changes
were ignored.

Signed-off-by: Justus Winter <justus@g10code.com>
(cherry picked from commit b0348fdb26637b0bcbd68a96c1746a1613b309af)

Gbp-Pq: Name 0013-tools-Improve-error-handling.patch

tools/gpgconf-comp.c

index 85eb80ab54387c64bac2d80a826a8845a4faa573..180fd65c29aa998fccf2e16c8f0196f2a8e779c2 100644 (file)
@@ -3328,6 +3328,8 @@ gc_component_change_options (int component, estream_t in, estream_t out,
 
           change_one_value (option, runtime, flags, new_value, 0);
         }
+      if (length < 0 || gpgrt_ferror (in))
+       gc_error (1, errno, "error reading stream 'in'");
     }
 
   /* Now that we have collected and locally verified the changes,