summaryrefslogtreecommitdiff
path: root/usr.bin/newsyslog
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2016-06-01 16:57:49 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2016-06-01 16:57:49 +0000
commit0938d3bdca39acadf3e951275e680be03c644a8e (patch)
treee4ba01a6305114fc43db3f37955ab00e173492fd /usr.bin/newsyslog
parent907a90eed57a528582f45f1879c80f8f4b21b318 (diff)
instead of using the makefile to override ancient defaults in the code,
change the code to reflect modern reality. ok deraadt millert natano
Diffstat (limited to 'usr.bin/newsyslog')
-rw-r--r--usr.bin/newsyslog/Makefile10
-rw-r--r--usr.bin/newsyslog/newsyslog.c34
2 files changed, 8 insertions, 36 deletions
diff --git a/usr.bin/newsyslog/Makefile b/usr.bin/newsyslog/Makefile
index 1f24d6cd1d8..1bb0ce36439 100644
--- a/usr.bin/newsyslog/Makefile
+++ b/usr.bin/newsyslog/Makefile
@@ -1,15 +1,7 @@
-# $OpenBSD: Makefile,v 1.6 2016/03/30 06:38:46 jmc Exp $
+# $OpenBSD: Makefile,v 1.7 2016/06/01 16:57:48 tedu Exp $
PROG= newsyslog
-CFLAGS+= -DCONF=\"/etc/newsyslog.conf\"
-CFLAGS+= -DPIDFILE=\"/var/run/syslog.pid\"
-CFLAGS+= -DCOMPRESS=\"/usr/bin/gzip\"
-CFLAGS+= -DCOMPRESS_POSTFIX=\".gz\"
-CFLAGS+= -DSTATS_DIR=\"/var/run\"
-CFLAGS+= -DSENDMAIL=\"/usr/sbin/sendmail\"
-CFLAGS+= -DQUAD_OFF_T
-
BINOWN= root
MAN= newsyslog.8
diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c
index c0fa180de9d..0120e56907f 100644
--- a/usr.bin/newsyslog/newsyslog.c
+++ b/usr.bin/newsyslog/newsyslog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newsyslog.c,v 1.100 2016/01/11 19:26:04 tb Exp $ */
+/* $OpenBSD: newsyslog.c,v 1.101 2016/06/01 16:57:48 tedu Exp $ */
/*
* Copyright (c) 1999, 2002, 2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -71,24 +71,12 @@
*
*/
-#ifndef CONF
-#define CONF "/etc/newsyslog.conf" /* Configuration file */
-#endif
-#ifndef PIDFILE
-#define PIDFILE "/etc/syslog.pid"
-#endif
-#ifndef COMPRESS
-#define COMPRESS "/usr/bin/compress" /* File compression program */
-#endif
-#ifndef COMPRESS_POSTFIX
-#define COMPRESS_POSTFIX ".Z"
-#endif
-#ifndef STATS_DIR
-#define STATS_DIR "/etc"
-#endif
-#ifndef SENDMAIL
-#define SENDMAIL "/usr/lib/sendmail"
-#endif
+#define CONF "/etc/newsyslog.conf"
+#define PIDFILE "/var/run/syslog.pid"
+#define COMPRESS "/usr/bin/gzip"
+#define COMPRESS_POSTFIX ".gz"
+#define STATS_DIR "/var/run"
+#define SENDMAIL "/usr/sbin/sendmail"
#include <sys/param.h> /* DEV_BSIZE */
#include <sys/stat.h>
@@ -1002,11 +990,7 @@ domonitor(struct conf_entry *ent)
warn("%s", fname);
goto cleanup;
}
-#ifdef QUAD_OFF_T
if (fscanf(fp, "%lld\n", &osize) != 1) {
-#else
- if (fscanf(fp, "%ld\n", &osize) != 1) {
-#endif /* QUAD_OFF_T */
fclose(fp);
goto update;
}
@@ -1060,11 +1044,7 @@ update:
warn("%s", fname);
goto cleanup;
}
-#ifdef QUAD_OFF_T
fprintf(fp, "%lld\n", (long long)sb.st_size);
-#else
- fprintf(fp, "%ld\n", (long)sb.st_size);
-#endif /* QUAD_OFF_T */
fclose(fp);
cleanup: