// 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)
{
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)" : "",
#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;