diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-08-23 18:56:12 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-08-23 18:56:12 +0100 |
commit | 631faad97171d7c1238b2e413c663cf61476f440 (patch) | |
tree | 294ffff6783308317aa1422e594068654fe41219 | |
parent | f15961911316460f7d45342d63c2d784a483f0d1 (diff) | |
download | libguestfs-631faad97171d7c1238b2e413c663cf61476f440.tar.gz libguestfs-631faad97171d7c1238b2e413c663cf61476f440.tar.xz libguestfs-631faad97171d7c1238b2e413c663cf61476f440.zip |
pclose: Fix other places where we only tested pclose == -1.
pclose can return > 0 when the status of the command was non-zero.
-rw-r--r-- | fish/fish.c | 2 | ||||
-rw-r--r-- | generator/generator_capitests.ml | 2 | ||||
-rw-r--r-- | src/appliance.c | 2 | ||||
-rw-r--r-- | src/dbdump.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/fish/fish.c b/fish/fish.c index efc74b26..c132911f 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -995,7 +995,7 @@ execute_and_inline (const char *cmd, int global_exit_on_error) free (line); - if (pclose (pp) == -1) { + if (pclose (pp) != 0) { perror ("pclose"); return -1; } diff --git a/generator/generator_capitests.ml b/generator/generator_capitests.ml index 963ed514..2cad2aec 100644 --- a/generator/generator_capitests.ml +++ b/generator/generator_capitests.ml @@ -106,7 +106,7 @@ md5sum (const char *filename, char *result) perror (\"md5sum: fread\"); exit (EXIT_FAILURE); } - if (pclose (pp) == -1) { + if (pclose (pp) != 0) { perror (\"pclose\"); exit (EXIT_FAILURE); } diff --git a/src/appliance.c b/src/appliance.c index 1df8c361..9f869540 100644 --- a/src/appliance.c +++ b/src/appliance.c @@ -241,7 +241,7 @@ calculate_supermin_checksum (guestfs_h *g, const char *supermin_path) return NULL; } - if (pclose (pp) == -1) { + if (pclose (pp) != 0) { warning (g, "pclose: %m"); return NULL; } diff --git a/src/dbdump.c b/src/dbdump.c index caf63768..45c67c62 100644 --- a/src/dbdump.c +++ b/src/dbdump.c @@ -129,7 +129,7 @@ guestfs___read_db_dump (guestfs_h *g, } /* Catch errors from the db_dump command. */ - if (pclose (pp) == -1) { + if (pclose (pp) != 0) { perrorf (g, "pclose: %s", cmd); goto out; } |