daemonize
daemonize copied to clipboard
no-return-in-nonvoid-function
I'm getting this after a build on openSUSE. Does anyone knows how to fix it?
I: Program is using implicit definitions of functions getting pointers or implemented by macros. These functions need to use their correct prototypes to allow correct argument passing on e.g. x86_64 .
- Implicit memory/string functions need #include <string.h>.
- Implicit *printf functions need #include <stdio.h>.
- Implicit *printf functions need #include <stdio.h>.
- Implicit read functions need #include <unistd.h>.
- Implicit recv functions need #include <sys/socket.h>. W: daemonize implicit-pointer-decl daemonize.c:283
I: Program returns random data in a function E: daemonize no-return-in-nonvoid-function daemonize.c:531
I: Program returns random data in a function E: daemonize no-return-in-nonvoid-function daemonize.c:531
I think this is a fairly quick fix. I'll try to get to it tonight.
It's tested. That one works:
Index: daemonize.c
===================================================================
--- daemonize.c.orig
+++ daemonize.c
@@ -523,6 +523,12 @@ int main(int argc, char **argv)
execvp(cmd[0], cmd);
die("Can't exec \"%s\": %s\n", cmd[0], strerror (errno));
+
+ /* Make sure there's a return value, so compiler doesn't complain
+ * Patch by Sascha Manns , 09 December 2013
+ */
+ return 0;
+
}
/* vim: set et sw=4 sts=4 : */