mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
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:
+5
-5
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user