Ignore:
Timestamp:
26/07/06 11:18:55 (13 years ago)
Author:
spascoe
Message:

I've created a bbftpd log facility to replace syslog.
At present it allows you to log messages to a file in addition
to syslog. This should help testing on other machines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/signals_routines.c

    r773 r1328  
    3535#include <signal.h> 
    3636#include <sys/wait.h> 
    37 #include <syslog.h> 
     37#include <bbftpd_log.h> 
    3838#include <netinet/in.h> 
    3939#include <sys/socket.h> 
     
    139139                    if ( childendinerror == 0 ) { 
    140140                        childendinerror = 1 ; 
    141                         syslog(BBFTPD_ERR,"Child pid %d ends in error status %d",pid,retcode) ; 
     141                        bbftpd_log(BBFTPD_ERR,"Child pid %d ends in error status %d",pid,retcode) ; 
    142142                        if ( unlinkfile == 1 ) unlink(currentfilename) ; 
    143143                        if (retcode == 255) { 
     
    153153                        } 
    154154                    } else { 
    155                         syslog(BBFTPD_ERR,"Child pid %d ends in error",pid) ; 
     155                        bbftpd_log(BBFTPD_ERR,"Child pid %d ends in error",pid) ; 
    156156                    } 
    157157                } 
     
    211211    sga.sa_flags = 0   ; 
    212212    if ( sigaction(SIGPIPE,&sga,0) < 0 ) { 
    213         syslog(BBFTPD_ERR,"Error sigaction SIGPIPE : %s",strerror(errno)) ; 
     213        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGPIPE : %s",strerror(errno)) ; 
    214214        return(-1) ; 
    215215    } 
     
    218218    sga.sa_flags = 0  ; 
    219219    if ( sigaction(SIGCHLD,&sga,0) < 0 ) { 
    220         syslog(BBFTPD_ERR,"Error sigaction SIGCHLD : %s",strerror(errno)) ; 
     220        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGCHLD : %s",strerror(errno)) ; 
    221221        return(-1) ; 
    222222    } 
     
    225225    sga.sa_flags = 0  ; 
    226226    if ( sigaction(SIGHUP,&sga,0) < 0 ) { 
    227         syslog(BBFTPD_ERR,"Error sigaction SIGHUP : %s",strerror(errno)) ; 
     227        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGHUP : %s",strerror(errno)) ; 
    228228        return(-1) ; 
    229229    } 
     
    232232    sga.sa_flags = 0  ; 
    233233    if ( sigaction(SIGTERM,&sga,0) < 0 ) { 
    234         syslog(BBFTPD_ERR,"Error sigaction SIGTERM : %s",strerror(errno)) ; 
     234        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGTERM : %s",strerror(errno)) ; 
    235235        return(-1) ; 
    236236    } 
Note: See TracChangeset for help on using the changeset viewer.