]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed some build errors in purge tool.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 20 Aug 2010 11:29:35 +0000 (13:29 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 20 Aug 2010 11:29:35 +0000 (13:29 +0200)
tools/purge/copyout.cc
tools/purge/signal.cc

index b12f11b3ab31d462b8b1f91ffdddc1db01e61c2d..eb4987dd349547b50f72a776d8f91edc6f47e8f6 100644 (file)
@@ -234,12 +234,14 @@ copy_out( size_t filesize, size_t metasize, unsigned debug,
     // seek end of output file ...
     off_t position = lseek( out, filesize-metasize-1, SEEK_SET );
     if ( position == -1 ) {
-        fprintf( stderr, "lseek(%s,%lu): %s\n", filename, filesize-metasize,
+        fprintf( stderr, "lseek(%s,%lu): %s\n", filename, 
+                 (unsigned long)filesize-metasize,
                  strerror(errno) );
         BAUTZ(false);
     } else if ( debug & 0x02 ) {
         fprintf( stderr, "# filesize=%lu, metasize=%lu, filepos=%ld\n",
-                 filesize, metasize, position );
+                 (unsigned long)filesize, (unsigned long)metasize,
+                 (long)position );
     }
 
     // ...and write 1 byte there (create a file that length)
index ee2411e204fafec4cbeece2d7759a44f0fd8f1ff..10f1c2ab3b9853241478932a35a34d94d7f134f9 100644 (file)
@@ -110,15 +110,14 @@ sigChild( int signo )
 {
     pid_t pid;
     int  status = signo; // to stop GNU from complaining...
-    char line[128];
 
     int saveerr = errno;
     while ( (pid = waitpid( -1, &status, WNOHANG )) > 0 ) {
         if ( WIFEXITED(status) ) {
-            snprintf( line, 128, "child (pid=%ld) reaped, status %d\n%c",
+            fprintf( stderr, "child (pid=%ld) reaped, status %d\n%c",
                       (long) pid, WEXITSTATUS(status), 0 );
         } else if ( WIFSIGNALED(status) ) {
-            snprintf( line, 128, "child (pid=%ld) died on signal %d%s\n%c",
+            fprintf( stderr, "child (pid=%ld) died on signal %d%s\n%c",
                       (long) pid, WTERMSIG(status),
 #ifdef WCOREDUMP
                       WCOREDUMP(status) ? " (core generated)" : "",
@@ -127,10 +126,9 @@ sigChild( int signo )
 #endif
                       0 );
         } else {
-            snprintf( line, 128, "detected dead child (pid=%ld), status %d\n%c",
+            fprintf( stderr, "detected dead child (pid=%ld), status %d\n%c",
                       (long) pid, status, 0 );
         }
-        write( STDERR_FILENO, line, strlen(line) );
     }
     errno = saveerr;