Misc, cleanup remaining SYSV #ifdefs and simplify a bit
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
5114907afe
commit
3309fb2d50
@ -25,17 +25,17 @@ AM_CFLAGS += -Wno-unused-result -Wno-unused-parameter
|
|||||||
AM_CFLAGS += -fomit-frame-pointer -fno-strength-reduce
|
AM_CFLAGS += -fomit-frame-pointer -fno-strength-reduce
|
||||||
|
|
||||||
syslogd_SOURCES = syslogd.c pidfile.c pidfile.h
|
syslogd_SOURCES = syslogd.c pidfile.c pidfile.h
|
||||||
syslogd_CPPFLAGS = -DSYSV -DINET6 -D_BSD_SOURCE -D_SVID_SOURCE -D_DEFAULT_SOURCE
|
syslogd_CPPFLAGS = -DINET6 -D_BSD_SOURCE -D_SVID_SOURCE -D_DEFAULT_SOURCE
|
||||||
|
|
||||||
klogd_SOURCES = klogd.c klogd.h syslog.c pidfile.c pidfile.h \
|
klogd_SOURCES = klogd.c klogd.h syslog.c pidfile.c pidfile.h \
|
||||||
ksym.c ksyms.h ksym_mod.c module.h
|
ksym.c ksyms.h ksym_mod.c module.h
|
||||||
klogd_CPPFLAGS = -DSYSV -DALLOW_KERNEL_LOGGING \
|
klogd_CPPFLAGS = -DALLOW_KERNEL_LOGGING \
|
||||||
-D_BSD_SOURCE -D_SVID_SOURCE -D_DEFAULT_SOURCE
|
-D_BSD_SOURCE -D_SVID_SOURCE -D_DEFAULT_SOURCE
|
||||||
|
|
||||||
logger_SOURCES = logger.c syslog.c
|
logger_SOURCES = logger.c syslog.c
|
||||||
logger_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE
|
logger_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE
|
||||||
|
|
||||||
tsyslogd_SOURCES = syslogd.c pidfile.c pidfile.h
|
tsyslogd_SOURCES = syslogd.c pidfile.c pidfile.h
|
||||||
tsyslogd_CPPFLAGS = -DSYSV -DINET6 -D_BSD_SOURCE -D_SVID_SOURCE -D_DEFAULT_SOURCE -DTESTING
|
tsyslogd_CPPFLAGS = -DINET6 -D_BSD_SOURCE -D_SVID_SOURCE -D_DEFAULT_SOURCE -DTESTING
|
||||||
|
|
||||||
syslog_tst_SOURCES = syslog_tst.c
|
syslog_tst_SOURCES = syslog_tst.c
|
||||||
|
@ -18,9 +18,9 @@
|
|||||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
CC= gcc
|
CC= gcc
|
||||||
#SKFLAGS= -g -DSYSV -Wall
|
#SKFLAGS= -g -Wall
|
||||||
#LDFLAGS= -g
|
#LDFLAGS= -g
|
||||||
SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce
|
SKFLAGS= $(RPM_OPT_FLAGS) -O3 -fomit-frame-pointer -Wall -fno-strength-reduce
|
||||||
# -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
# -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
||||||
# -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
|
# -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
|
||||||
# $(shell getconf LFS_SKFLAGS)
|
# $(shell getconf LFS_SKFLAGS)
|
||||||
|
@ -852,7 +852,7 @@ void debug_switch();
|
|||||||
void logerror(const char *type);
|
void logerror(const char *type);
|
||||||
void die(int sig);
|
void die(int sig);
|
||||||
#ifndef TESTING
|
#ifndef TESTING
|
||||||
void doexit(int sig);
|
void doexit(int sig);
|
||||||
#endif
|
#endif
|
||||||
void init();
|
void init();
|
||||||
static int strtobytes(char *arg);
|
static int strtobytes(char *arg);
|
||||||
@ -2110,11 +2110,7 @@ void fprintlog(struct filed *f, char *from, int flags, char *msg)
|
|||||||
|
|
||||||
case F_CONSOLE:
|
case F_CONSOLE:
|
||||||
f->f_time = now;
|
f->f_time = now;
|
||||||
#ifdef UNIXPC
|
|
||||||
if (1) {
|
|
||||||
#else
|
|
||||||
if (flags & IGN_CONS) {
|
if (flags & IGN_CONS) {
|
||||||
#endif
|
|
||||||
logit(" (ignored).\n");
|
logit(" (ignored).\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2196,9 +2192,6 @@ void fprintlog(struct filed *f, char *from, int flags, char *msg)
|
|||||||
f->f_prevcount = 0;
|
f->f_prevcount = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if FALSE
|
|
||||||
} /* balance parentheses for emacs */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
jmp_buf ttybuf;
|
jmp_buf ttybuf;
|
||||||
|
|
||||||
@ -2237,10 +2230,7 @@ void wallmsg(struct filed *f, struct iovec *iov)
|
|||||||
if (fork() == 0) {
|
if (fork() == 0) {
|
||||||
(void)signal(SIGTERM, SIG_DFL);
|
(void)signal(SIGTERM, SIG_DFL);
|
||||||
(void)alarm(0);
|
(void)alarm(0);
|
||||||
#ifndef SYSV
|
|
||||||
(void)signal(SIGTTOU, SIG_IGN);
|
|
||||||
(void)sigsetmask(0);
|
|
||||||
#endif
|
|
||||||
(void)snprintf(greetings, sizeof(greetings),
|
(void)snprintf(greetings, sizeof(greetings),
|
||||||
"\r\n\7Message from syslogd@%s at %.24s ...\r\n",
|
"\r\n\7Message from syslogd@%s at %.24s ...\r\n",
|
||||||
(char *)iov[2].iov_base, ctime(&now));
|
(char *)iov[2].iov_base, ctime(&now));
|
||||||
@ -2308,18 +2298,19 @@ void wallmsg(struct filed *f, struct iovec *iov)
|
|||||||
void reapchild(int signo)
|
void reapchild(int signo)
|
||||||
{
|
{
|
||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
#if defined(SYSV) && !defined(linux)
|
|
||||||
(void)signal(SIGCHLD, reapchild); /* reset signal handler -ASP */
|
#ifdef linux
|
||||||
wait(NULL);
|
|
||||||
#else
|
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
while (wait3(&status, WNOHANG, (struct rusage *)NULL) > 0)
|
while (wait3(&status, WNOHANG, NULL) > 0)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
signal(SIGCHLD, reapchild); /* reset signal handler -ASP */
|
||||||
|
#else
|
||||||
|
signal(SIGCHLD, reapchild); /* reset signal handler -ASP */
|
||||||
|
wait(NULL);
|
||||||
#endif
|
#endif
|
||||||
#ifdef linux
|
|
||||||
(void)signal(SIGCHLD, reapchild); /* reset signal handler -ASP */
|
|
||||||
#endif
|
|
||||||
errno = saved_errno;
|
errno = saved_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user