fl.l_len = 1;
#ifdef CONFIG_FEATURE_IPC_SYSLOG
- if ((circular_logging == TRUE) && (buf != NULL)){
+ if ((circular_logging) && (buf != NULL)){
char b[1024];
va_start (arguments, fmt);
vsprintf (b, fmt, arguments);
v->iov_base = msg;
v->iov_len = strlen(msg);
+writev_retry:
if ( -1 == writev(remotefd,iov, IOV_COUNT)){
- error_msg_and_die("syslogd: cannot write to remote file handle on"
+ if (errno == EINTR) goto writev_retry;
+ error_msg_and_die("syslogd: cannot write to remote file handle on"
"%s:%d",RemoteHost,RemotePort);
}
}
- if (local_logging == TRUE)
+ if (local_logging)
#endif
/* now spew out the message to wherever it is supposed to go */
message("%s %s %s %s\n", timestamp, LocalHostName, res, msg);
FD_SET (sock_fd, &fds);
#ifdef CONFIG_FEATURE_IPC_SYSLOG
- if (circular_logging == TRUE ){
+ if (circular_logging ){
ipcsyslog_init();
}
#endif
#ifdef CONFIG_FEATURE_REMOTE_LOG
- if (doRemoteLog == TRUE){
+ if (doRemoteLog){
init_RemoteLog();
}
#endif
doFork = FALSE;
break;
case 'O':
- logFilePath = strdup(optarg);
+ logFilePath = xstrdup(optarg);
break;
#ifdef CONFIG_FEATURE_REMOTE_LOG
case 'R':
- RemoteHost = strdup(optarg);
+ RemoteHost = xstrdup(optarg);
if ( (p = strchr(RemoteHost, ':'))){
RemotePort = atoi(p+1);
*p = '\0';
#ifdef CONFIG_FEATURE_REMOTE_LOG
/* If they have not specified remote logging, then log locally */
- if (doRemoteLog == FALSE)
+ if (! doRemoteLog)
local_logging = TRUE;
#endif
umask(0);
- if (doFork == TRUE) {
+ if (doFork) {
#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
if (daemon(0, 1) < 0)
perror_msg_and_die("daemon");