From: serassio <> Date: Sun, 13 Mar 2005 16:23:33 +0000 (+0000) Subject: Bug #1257: compile warnings due to pid_t not being an int X-Git-Tag: SQUID_3_0_PRE4~849 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=36584579a9d2e78ae4106ea5cec4976a096de85b;p=thirdparty%2Fsquid.git Bug #1257: compile warnings due to pid_t not being an int Forward port of 2.5 patch and added use of debugs() where applicable --- diff --git a/helpers/ntlm_auth/SMB/ntlm.h b/helpers/ntlm_auth/SMB/ntlm.h index e839741d11..e3d123f7fb 100644 --- a/helpers/ntlm_auth/SMB/ntlm.h +++ b/helpers/ntlm_auth/SMB/ntlm.h @@ -53,7 +53,7 @@ static char *__foo; extern char debug_enabled; #define debug(X...) if (debug_enabled) { \ - fprintf(stderr,"ntlm-auth[%d](%s:%d): ", getpid(), \ + fprintf(stderr,"ntlm-auth[%ld](%s:%d): ", (long)getpid(), \ ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\ __LINE__);\ fprintf(stderr,X); } diff --git a/helpers/ntlm_auth/SMB/ntlm_auth.c b/helpers/ntlm_auth/SMB/ntlm_auth.c index a2126dd82c..8bd47060e7 100644 --- a/helpers/ntlm_auth/SMB/ntlm_auth.c +++ b/helpers/ntlm_auth/SMB/ntlm_auth.c @@ -328,7 +328,7 @@ manage_request() alarm(0); signal(SIGALRM, SIG_DFL); if (got_timeout != 0) { - fprintf(stderr, "ntlm-auth[%d]: Timeout during authentication.\n", getpid()); + fprintf(stderr, "ntlm-auth[%ld]: Timeout during authentication.\n", (long)getpid()); SEND("BH Timeout during authentication"); got_timeout = 0; return; diff --git a/src/main.cc b/src/main.cc index c8a8515953..f230aa9e3b 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.403 2005/01/08 10:09:31 serassio Exp $ + * $Id: main.cc,v 1.404 2005/03/13 09:23:33 serassio Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -424,10 +424,10 @@ shut_down(int sig) #ifdef KILL_PARENT_OPT if (getppid() > 1) { - debug(1, 1) ("Killing RunCache, pid %d\n", getppid()); + debugs(1, 1, "Killing RunCache, pid " << getppid()); if (kill(getppid(), sig) < 0) - debug(1, 1) ("kill %d: %s\n", getppid(), xstrerror()); + debugs(1, 1, "kill " << getppid() << ": " << xstrerror()); } #endif @@ -695,7 +695,7 @@ mainInitialize(void) #endif - debug(1, 1) ("Process ID %d\n", (int) getpid()); + debugs(1, 1, "Process ID " << getpid()); debug(1, 1) ("With %d file descriptors available\n", Squid_MaxFD); diff --git a/src/tools.cc b/src/tools.cc index 135adbeb65..c336b74cbc 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.251 2005/02/06 09:37:15 serassio Exp $ + * $Id: tools.cc,v 1.252 2005/03/13 09:23:33 serassio Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -640,7 +640,7 @@ uniqueHostname(void) void leave_suid(void) { - debug(21, 3) ("leave_suid: PID %d called\n", (int) getpid()); + debugs(21, 3, "leave_suid: PID " << getpid() << " called"); if (Config.effectiveGroup) { @@ -662,8 +662,7 @@ leave_suid(void) if (Config.effectiveUser == NULL) return; - debug(21, 3) ("leave_suid: PID %d giving up root, becoming '%s'\n", - (int) getpid(), Config.effectiveUser); + debugs(21, 3, "leave_suid: PID " << getpid() << " giving up root, becoming '" << Config.effectiveUser << "'"); if (!Config.effectiveGroup) { @@ -699,7 +698,7 @@ leave_suid(void) void enter_suid(void) { - debug(21, 3) ("enter_suid: PID %d taking root priveleges\n", (int) getpid()); + debugs(21, 3, "enter_suid: PID " << getpid() << " taking root priveleges"); #if HAVE_SETRESUID setresuid((uid_t)-1, 0, (uid_t)-1); @@ -718,7 +717,7 @@ no_suid(void) uid_t uid; leave_suid(); uid = geteuid(); - debug(21, 3) ("leave_suid: PID %d giving up root priveleges forever\n", (int) getpid()); + debugs(21, 3, "leave_suid: PID " << getpid() << " giving up root priveleges forever"); #if HAVE_SETRESUID if (setresuid(uid, uid, uid) < 0)