pclose can return > 0 when the status of the command was non-zero.
free (line);
- if (pclose (pp) == -1) {
+ if (pclose (pp) != 0) {
perror ("pclose");
return -1;
}
perror (\"md5sum: fread\");
exit (EXIT_FAILURE);
}
- if (pclose (pp) == -1) {
+ if (pclose (pp) != 0) {
perror (\"pclose\");
exit (EXIT_FAILURE);
}
return NULL;
}
- if (pclose (pp) == -1) {
+ if (pclose (pp) != 0) {
warning (g, "pclose: %m");
return NULL;
}
}
/* Catch errors from the db_dump command. */
- if (pclose (pp) == -1) {
+ if (pclose (pp) != 0) {
perrorf (g, "pclose: %s", cmd);
goto out;
}