From 4ecce6f3e7519e8acc694712bd6a8d56a01f2fef Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 3 Oct 2011 13:23:07 +0200 Subject: [PATCH] Fix various compiler warnings Sgined-off-by: Hans de Goede --- src/vdagent.c | 6 +++--- src/vdagentd.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vdagent.c b/src/vdagent.c index f0d3b32..f475120 100644 --- a/src/vdagent.c +++ b/src/vdagent.c @@ -75,7 +75,7 @@ void daemon_read_complete(struct udscs_connection **connp, free(data); break; case VDAGENTD_VERSION: - if (strcmp(data, VERSION) != 0) { + if (strcmp((char *)data, VERSION) != 0) { fprintf(logfile, "Fatal vdagentd version mismatch: got %s expected %s\n", data, VERSION); @@ -131,7 +131,7 @@ void daemonize(void) case 0: close(0); close(1); close(2); setsid(); - x = open("/dev/null", O_RDWR); dup(x); dup(x); + x = open("/dev/null", O_RDWR); x = dup(x); x = dup(x); break; case -1: fprintf(logfile, "fork: %s\n", strerror(errno)); @@ -207,7 +207,7 @@ int main(int argc, char *argv[]) } if (file_test(portdev) != 0) { - fprintf(logfile, "Missing virtio device: %s\n", + fprintf(logfile, "Missing virtio device '%s': %s\n", portdev, strerror(errno)); retval = 1; goto finish; diff --git a/src/vdagentd.c b/src/vdagentd.c index 939d36a..3419601 100644 --- a/src/vdagentd.c +++ b/src/vdagentd.c @@ -650,7 +650,7 @@ void daemonize(void) case 0: close(0); close(1); close(2); setsid(); - x = open("/dev/null", O_RDWR); dup(x); dup(x); + x = open("/dev/null", O_RDWR); x = dup(x); x = dup(x); pidfile = fopen(pidfilename, "w"); if (pidfile) { fprintf(pidfile, "%d\n", (int)getpid()); -- 2.11.4.GIT