avoid calling exit with a constant; use EXIT_* instead

This appeases a new gnulib-provided "syntax-check".
* daemon/libvirtd.c (main): Use EXIT_FAILURE, not 1.
* proxy/libvirt_proxy.c (main): Likewise, and EXIT_SUCCESS, not 0.
* tests/conftest.c (main): Likewise.
* tests/reconnect.c (main): Likewise.
* tests/testutils.h (EXIT_AM_SKIP): Define.
* tests/nodeinfotest.c (mymain): Use EXIT_AM_SKIP, not 77.
* tests/qemuargv2xmltest.c: Likewise.
* tests/qemuxml2xmltest.c: Likewise.
* tests/virshtest.c (mymain): Likewise.
This commit is contained in:
Jim Meyering
2009-12-15 17:46:04 +01:00
parent e7c8ab8f0e
commit 2e5efc3d6e
9 changed files with 23 additions and 21 deletions
+5 -5
View File
@@ -15,23 +15,23 @@ int main(int argc, char **argv) {
if (argc != 2) {
fprintf(stderr, "Usage: %s conf_file\n", argv[0]);
exit(1);
exit(EXIT_FAILURE);
}
conf = virConfReadFile(argv[1], 0);
if (conf == NULL) {
fprintf(stderr, "Failed to process %s\n", argv[1]);
exit(2);
exit(EXIT_FAILURE);
}
ret = virConfWriteMem(&buffer[0], &len, conf);
if (ret < 0) {
fprintf(stderr, "Failed to serialize %s back\n", argv[1]);
exit(3);
exit(EXIT_FAILURE);
}
virConfFree(conf);
if (fwrite(buffer, 1, len, stdout) != len) {
fprintf(stderr, "Write failed: %s\n", strerror (errno));
exit(1);
exit(EXIT_FAILURE);
}
exit(0);
exit(EXIT_SUCCESS);
}