[PATCH] Remove the STANDALONE #ifdef from auditd.
David Shea
dshea at redhat.com
Wed Jul 30 13:24:50 UTC 2014
We don't care about the non-standalone case anymore, and the ifdef
confuses cppcheck.
---
pyanaconda/isys/Makefile.am | 2 +-
pyanaconda/isys/auditd.c | 14 --------------
2 files changed, 1 insertion(+), 15 deletions(-)
diff --git a/pyanaconda/isys/Makefile.am b/pyanaconda/isys/Makefile.am
index cdb3baf..dbf0f62 100644
--- a/pyanaconda/isys/Makefile.am
+++ b/pyanaconda/isys/Makefile.am
@@ -33,7 +33,7 @@ _isys_la_SOURCES = isys.c
auditddir = $(libexecdir)/$(PACKAGE_NAME)
auditd_PROGRAMS = auditd
auditd_SOURCES = auditd.c
-auditd_CFLAGS = -DSTANDALONE $(SELINUX_CFLAGS)
+auditd_CFLAGS = $(SELINUX_CFLAGS)
auditd_LDFLAGS = -laudit
MAINTAINERCLEANFILES = Makefile.in
diff --git a/pyanaconda/isys/auditd.c b/pyanaconda/isys/auditd.c
index d598f8d..a75289c 100644
--- a/pyanaconda/isys/auditd.c
+++ b/pyanaconda/isys/auditd.c
@@ -107,14 +107,6 @@ int audit_daemonize(void) {
if (child < 0)
return -1;
-#ifndef STANDALONE
- for (fd = 0; fd < getdtablesize(); fd++)
- close(fd);
- signal(SIGTTOU, SIG_IGN);
- signal(SIGTTIN, SIG_IGN);
- signal(SIGTSTP, SIG_IGN);
-#endif /* !defined(STANDALONE) */
-
if ((fd = open("/proc/self/oom_score_adj", O_RDWR)) >= 0) {
write(fd, "-1000", 5);
close(fd);
@@ -123,14 +115,9 @@ int audit_daemonize(void) {
do_auditd(fd);
audit_close(fd);
-#ifndef STANDALONE
- exit(0);
-#endif /* !defined(STANDALONE) */
-
return 0;
}
-#ifdef STANDALONE
int main(void) {
if (audit_daemonize() < 0)
{
@@ -140,7 +127,6 @@ int main(void) {
return 0;
}
-#endif /* STANDALONE */
/*
* vim:ts=8:sw=4:sts=4:et
--
2.0.0
More information about the anaconda-patches
mailing list