[mw-devel] MW3 r1027 - in trunk: . src

welshbyte at sucs.org welshbyte at sucs.org
Wed Apr 2 09:13:55 BST 2008


Author: welshbyte
Date: 2008-04-02 09:13:54 +0100 (Wed, 02 Apr 2008)
New Revision: 1027

Modified:
   trunk/mw.spec
   trunk/src/Makefile
   trunk/src/bb.h
   trunk/src/perms.c
Log:
Make the log file location configurable and default to /var/log/mw/log.bb.


Modified: trunk/mw.spec
===================================================================
--- trunk/mw.spec	2008-04-01 16:14:54 UTC (rev 1026)
+++ trunk/mw.spec	2008-04-02 08:13:54 UTC (rev 1027)
@@ -41,6 +41,7 @@
 %{_libdir}/mw/colour
 %attr(771,mw,mw) %{_libdir}/mw/mesgs
 %attr(751,mw,mw) %{_libdir}/mw/rooms
+%attr(755,mw,mw) %dir /var/log/mw
 %config %attr(640,mw,mw) %{_libdir}/mw/login.banner
 %{_libdir}/mw/help
 %{_libdir}/mw/mudhelp

Modified: trunk/src/Makefile
===================================================================
--- trunk/src/Makefile	2008-04-01 16:14:54 UTC (rev 1026)
+++ trunk/src/Makefile	2008-04-02 08:13:54 UTC (rev 1027)
@@ -1,6 +1,8 @@
 # install path is in /usr/local/lib, for historical reasons
 libdir ?= /usr/local/lib
 bindir ?= /usr/local/bin
+localstatedir ?= /var
+LOGDIR := $(localstatedir)/log/mw
 HOMEPATH := $(libdir)/mw
 TMPDIR = /tmp
 
@@ -29,6 +31,7 @@
 DEFS+= -DVER_MIN=\"$(VERSION_MINOR)\"
 DEFS+= -DVER_TWK=\"$(VERSION_TWEAK)\"
 DEFS+= -DHOMEPATH=\"$(HOMEPATH)\"
+DEFS+= -DLOGDIR=\"$(LOGDIR)\"
 
 ### uncomment for add Electric fence
 #LDFLAGS+= -L. -lefence
@@ -99,6 +102,7 @@
 
 install: mw
 	install -Ds mw $(bindir)/mw
+	install -d $(LOGDIR)
 
 clean:
 	-rm -f *.o *.d red mw del_user

Modified: trunk/src/bb.h
===================================================================
--- trunk/src/bb.h	2008-04-01 16:14:54 UTC (rev 1026)
+++ trunk/src/bb.h	2008-04-02 08:13:54 UTC (rev 1027)
@@ -12,7 +12,11 @@
 #define HOMEPATH	"/usr/local/lib/mw"
 #endif
 
-#define LOGFILE		"log.bb"
+#ifndef LOGDIR
+#define LOGDIR		"/var/log/mw"
+#endif
+
+#define LOGFILE		LOGDIR"/log.bb"
 #define LOGIN_BANNER	"login.banner"
 #define DEVEL_BANNER	"login.banner.devel"
 #define LOCKFILE	"/tmp/bb.locked"

Modified: trunk/src/perms.c
===================================================================
--- trunk/src/perms.c	2008-04-01 16:14:54 UTC (rev 1026)
+++ trunk/src/perms.c	2008-04-02 08:13:54 UTC (rev 1027)
@@ -345,7 +345,7 @@
 
 	va_start(ap, fmt);
 	
-	if ((file=open(makepath(LOGFILE,"",""),O_WRONLY|O_CREAT|O_APPEND,0600))<0)
+	if ((file=open(LOGFILE,O_WRONLY|O_CREAT|O_APPEND,0600))<0)
 	{
 		perror("log");
 		return;





More information about the mw-devel mailing list