git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dd: Missing include of <string.h>
[libguestfs.git]
/
daemon
/
guestfsd.c
diff --git
a/daemon/guestfsd.c
b/daemon/guestfsd.c
index
9375ede
..
eab8529
100644
(file)
--- a/
daemon/guestfsd.c
+++ b/
daemon/guestfsd.c
@@
-27,15
+27,18
@@
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <getopt.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <getopt.h>
-#include <netdb.h>
#include <sys/param.h>
#include <sys/param.h>
-#include <sys/select.h>
#include <sys/types.h>
#include <sys/types.h>
-#include <sys/wait.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
+#include <netdb.h>
+#include <sys/select.h>
+#include <sys/wait.h>
+
+#ifdef HAVE_PRINTF_H
#include <printf.h>
#include <printf.h>
+#endif
#include "c-ctype.h"
#include "ignore-value.h"
#include "c-ctype.h"
#include "ignore-value.h"
@@
-121,17
+124,17
@@
main (int argc, char *argv[])
case '?':
usage ();
case '?':
usage ();
- exit (
0
);
+ exit (
EXIT_SUCCESS
);
default:
fprintf (stderr, "guestfsd: unexpected command line option 0x%x\n", c);
default:
fprintf (stderr, "guestfsd: unexpected command line option 0x%x\n", c);
- exit (
1
);
+ exit (
EXIT_FAILURE
);
}
}
if (optind < argc) {
usage ();
}
}
if (optind < argc) {
usage ();
- exit (
1
);
+ exit (
EXIT_FAILURE
);
}
cmdline = read_cmdline ();
}
cmdline = read_cmdline ();
@@
-190,7
+193,7
@@
main (int argc, char *argv[])
vmchannel = strndup (p + 18, len);
if (!vmchannel) {
perror ("strndup");
vmchannel = strndup (p + 18, len);
if (!vmchannel) {
perror ("strndup");
- exit (
1
);
+ exit (
EXIT_FAILURE
);
}
}
}
}
@@
-204,7
+207,7
@@
main (int argc, char *argv[])
vmchannel = strndup (p + 4, len);
if (!vmchannel) {
perror ("strndup");
vmchannel = strndup (p + 4, len);
if (!vmchannel) {
perror ("strndup");
- exit (
1
);
+ exit (
EXIT_FAILURE
);
}
memcpy (vmchannel, "tcp:", 4);
}
}
memcpy (vmchannel, "tcp:", 4);
}
@@
-216,7
+219,7
@@
main (int argc, char *argv[])
vmchannel = strdup ("tcp:" GUESTFWD_ADDR ":" GUESTFWD_PORT);
if (!vmchannel) {
perror ("strdup");
vmchannel = strdup ("tcp:" GUESTFWD_ADDR ":" GUESTFWD_PORT);
if (!vmchannel) {
perror ("strdup");
- exit (
1
);
+ exit (
EXIT_FAILURE
);
}
}
}
}
@@
-241,7
+244,7
@@
main (int argc, char *argv[])
} else {
fprintf (stderr, "vmchannel: expecting \"tcp:<ip>:<port>\": %s\n",
vmchannel);
} else {
fprintf (stderr, "vmchannel: expecting \"tcp:<ip>:<port>\": %s\n",
vmchannel);
- exit (
1
);
+ exit (
EXIT_FAILURE
);
}
memset (&hints, 0, sizeof hints);
}
memset (&hints, 0, sizeof hints);
@@
-251,7
+254,7
@@
main (int argc, char *argv[])
if (r != 0) {
fprintf (stderr, "%s:%s: %s\n",
host, port, gai_strerror (r));
if (r != 0) {
fprintf (stderr, "%s:%s: %s\n",
host, port, gai_strerror (r));
- exit (
1
);
+ exit (
EXIT_FAILURE
);
}
/* Connect to the given TCP socket. */
}
/* Connect to the given TCP socket. */
@@
-272,7
+275,7
@@
main (int argc, char *argv[])
"unknown vmchannel connection type: %s\n"
"expecting \"tcp:<ip>:<port>\"\n",
vmchannel);
"unknown vmchannel connection type: %s\n"
"expecting \"tcp:<ip>:<port>\"\n",
vmchannel);
- exit (
1
);
+ exit (
EXIT_FAILURE
);
}
if (sock == -1) {
}
if (sock == -1) {
@@
-291,7
+294,7
@@
main (int argc, char *argv[])
"or on the libguestfs redhat com mailing list.\n"
"\n",
vmchannel);
"or on the libguestfs redhat com mailing list.\n"
"\n",
vmchannel);
- exit (
1
);
+ exit (
EXIT_FAILURE
);
}
/* Send the magic length message which indicates that
}
/* Send the magic length message which indicates that
@@
-304,7
+307,7
@@
main (int argc, char *argv[])
xdr_uint32_t (&xdr, &len);
if (xwrite (sock, lenbuf, sizeof lenbuf) == -1)
xdr_uint32_t (&xdr, &len);
if (xwrite (sock, lenbuf, sizeof lenbuf) == -1)
- exit (
1
);
+ exit (
EXIT_FAILURE
);
xdr_destroy (&xdr);
xdr_destroy (&xdr);
@@
-312,14
+315,14
@@
main (int argc, char *argv[])
if (!dont_fork) {
if (daemon (0, 1) == -1) {
perror ("daemon");
if (!dont_fork) {
if (daemon (0, 1) == -1) {
perror ("daemon");
- exit (
1
);
+ exit (
EXIT_FAILURE
);
}
}
/* Enter the main loop, reading and performing actions. */
main_loop (sock);
}
}
/* Enter the main loop, reading and performing actions. */
main_loop (sock);
- exit (
0
);
+ exit (
EXIT_SUCCESS
);
}
/* Read /proc/cmdline. */
}
/* Read /proc/cmdline. */