lib/util/fault.c - fix "pid_t" printf warning on Solaris
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 6 Dec 2010 10:27:05 +0000 (11:27 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 6 Dec 2010 10:28:59 +0000 (11:28 +0100)
According to "http://www.ibm.com/developerworks/linux/library/l-solar/"
it's generally a 32bit "int" - therefore this cast should fit.

lib/util/fault.c

index 11b31d751e8f46ab7f52b8d2a1dd082de2a382ff..bbb3190198f61092bab930433c605441afd4a780 100644 (file)
@@ -125,7 +125,7 @@ _PUBLIC_ _NORETURN_ void smb_panic(const char *why)
                char pidstr[20];
                char cmdstring[200];
                safe_strcpy(cmdstring, panic_action, sizeof(cmdstring));
-               snprintf(pidstr, sizeof(pidstr), "%u", getpid());
+               snprintf(pidstr, sizeof(pidstr), "%d", (int) getpid());
                all_string_sub(cmdstring, "%PID%", pidstr, sizeof(cmdstring));
                if (progname) {
                        all_string_sub(cmdstring, "%PROG%", progname, sizeof(cmdstring));