[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sanlock-devel
Subject:    wdmd/Makefile wdmd/main.c
From:       teigland () fedoraproject ! org (David Teigland)
Date:       2012-12-10 16:37:40
Message-ID: 20121210163740.92BC2A2E57 () fedorahosted ! org
[Download RAW message or body]

 wdmd/Makefile |    2 +-
 wdmd/main.c   |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 478582b58f8ff203bc9513c4387e07d34d16fe66
Author: Federico Simoncelli <fsimonce at redhat.com>
Date:   Mon Dec 10 17:33:58 2012 +0100

    wdmd: fix miscellaneous build warnings
    
    Fixed warnings:
    * wdmd: _FORTIFY_SOURCE requires compiling with optimization (-O)
    * wdmd: initialization discards ‘const' qualifier from pointer target type
    * ignoring return value of ‘write'
    
    Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>

diff --git a/wdmd/Makefile b/wdmd/Makefile
index de6b035..bf871c5 100644
--- a/wdmd/Makefile
+++ b/wdmd/Makefile
@@ -21,7 +21,7 @@ LIB_SOURCE = client.c wdmd_sock.c
 
 TEST_SOURCE = wdmd_client.c
 
-CFLAGS += -D_GNU_SOURCE -g \
+CFLAGS += -D_GNU_SOURCE -g -O2 \
 	-Wall \
 	-Wformat \
 	-Wformat-security \
diff --git a/wdmd/main.c b/wdmd/main.c
index d1666b9..126524c 100644
--- a/wdmd/main.c
+++ b/wdmd/main.c
@@ -63,8 +63,8 @@ static int shm_fd;
 
 static int allow_scripts;
 static int kill_script_sec;
-static char *scripts_dir = (char *)"/etc/wdmd.d";
-static char *watchdog_path = "/dev/watchdog";
+static const char *scripts_dir = "/etc/wdmd.d";
+static const char *watchdog_path = "/dev/watchdog";
 
 struct script_status {
 	uint64_t start;
@@ -1309,7 +1309,7 @@ static void print_debug_and_exit(void)
 	if (rv < 0)
 		exit(1);
 
-	write(STDOUT_FILENO, debug_buf, strlen(debug_buf));
+	rv = write(STDOUT_FILENO, debug_buf, strlen(debug_buf));
 
 	exit(0);
 }



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic