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.
default:
fprintf (stderr, "libvirtd: internal error: unknown flag: %c\n",
c);
- exit (1);
+ exit (EXIT_FAILURE);
}
}
persist = 1;
} else {
usage(argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if (geteuid() != 0) {
fprintf(stderr, "%s must be run as root or suid\n", argv[0]);
- /* exit(1); */
+ /* exit(EXIT_FAILURE); */
}
/*
* failure.
*/
if (proxyListenUnixSocket(PROXY_SOCKET_PATH) < 0)
- exit(0);
+ exit(EXIT_SUCCESS);
if (proxyInitXen() == 0)
proxyMainLoop();
sleep(1);
proxyCloseUnixSocket();
- exit(0);
+ exit(EXIT_SUCCESS);
}
#else /* WITHOUT_XEN */
int main(void) {
fprintf(stderr, "libvirt was compiled without Xen support\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
#endif /* WITH_XEN */
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);
}
static int
mymain(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
{
- exit (77); /* means 'test skipped' for automake */
+ exit (EXIT_AM_SKIP);
}
#else
#else
-int main (void) { return (77); /* means 'test skipped' for automake */ }
+int main (void) { return (EXIT_AM_SKIP); }
#endif /* WITH_QEMU */
#else
-int main (void) { exit (77); /* means 'test skipped' to automake */ }
+int main (void) { exit (EXIT_AM_SKIP); }
#endif /* WITH_QEMU */
}
if (conn == NULL) {
fprintf(stderr, "First virConnectOpen() failed\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
dom = virDomainLookupByID(conn, id);
if (dom == NULL) {
fprintf(stderr, "First lookup for domain %d failed\n", id);
- exit(1);
+ exit(EXIT_FAILURE);
}
virDomainFree(dom);
virConnectClose(conn);
conn = virConnectOpen(NULL);
if (conn == NULL) {
fprintf(stderr, "Second virConnectOpen() failed\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
dom = virDomainLookupByID(conn, id);
if (dom == NULL) {
fprintf(stderr, "Second lookup for domain %d failed\n", id);
- exit(1);
+ exit(EXIT_FAILURE);
}
virDomainFree(dom);
virConnectClose(conn);
printf("OK\n");
- exit(0);
+ exit(EXIT_SUCCESS);
}
/*
* utils.c: test utils
*
- * Copyright (C) 2005, 2008 Red Hat, Inc.
+ * Copyright (C) 2005, 2008-2009 Red Hat, Inc.
*
* See COPYING.LIB for the License of this software
*
#include <stdio.h>
+#define EXIT_AM_SKIP 77 /* tell Automake we're skipping a test */
+
double virtTestCountAverage(double *items,
int nitems);
abs_srcdir = getcwd(cwd, sizeof(cwd));
#ifdef WIN32
- exit (77); /* means 'test skipped' for automake */
+ exit (EXIT_AM_SKIP);
#endif
snprintf(buffer, PATH_MAX-1, "test://%s/../examples/xml/test/testnode.xml", abs_srcdir);