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

welshbyte at sucs.org welshbyte at sucs.org
Wed Mar 26 21:28:15 GMT 2008


Author: welshbyte
Date: 2008-03-26 21:28:14 +0000 (Wed, 26 Mar 2008)
New Revision: 1017

Removed:
   trunk/users.bb
Modified:
   trunk/Makefile
   trunk/src/files.c
Log:
- Create empty users.bb if users.bb doesn't exist
- Remove users.bb from svn



Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2008-03-26 20:37:32 UTC (rev 1016)
+++ trunk/Makefile	2008-03-26 21:28:14 UTC (rev 1017)
@@ -5,7 +5,7 @@
 VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_TWEAK)
 
 # the non source files that should get installed
-INSTALLFILES = colour help login.banner mudhelp rooms scripthelp talkhelp wizhelp users.bb folders.bb COPYING INSTALL LICENSE README
+INSTALLFILES = colour help login.banner mudhelp rooms scripthelp talkhelp wizhelp folders.bb COPYING INSTALL LICENSE README
 
 ifndef TMPDIR
 rpm:

Modified: trunk/src/files.c
===================================================================
--- trunk/src/files.c	2008-03-26 20:37:32 UTC (rev 1016)
+++ trunk/src/files.c	2008-03-26 21:28:14 UTC (rev 1017)
@@ -13,16 +13,35 @@
 #include <errno.h>
 #include "strings.h"
 
-int openuserfile(int mode)
+int createuserfile()
 {
+	int fd;
+	fd = creat(makepath(USERFILE,"",""), 0600);
+	if (fd < 0) {
+		perror("Create User File");
+		return -1;
+	}
+	close(fd);
+	return 0;
+}
+
+int openuserfile(int flags)
+{
 	int x;
-	x=open(makepath(USERFILE,"",""),mode);
-	if (x<0)
+	x=open(makepath(USERFILE,"",""),flags);
+	if (x>=0) return x;
+
+	if (errno != ENOENT || createuserfile())
 	{
 		perror("Open User File");
 		exit(-1);
 	}
-	return(x);
+
+	x=open(makepath(USERFILE,"",""),flags);
+	if (x>=0) return x;
+
+	perror("Open User File After Create");
+	exit(-1);
 }
 
 int is_old(struct person *usr, const char *name, int32_t *userposn)

Deleted: trunk/users.bb
===================================================================
--- trunk/users.bb	2008-03-26 20:37:32 UTC (rev 1016)
+++ trunk/users.bb	2008-03-26 21:28:14 UTC (rev 1017)
@@ -1,3 +0,0 @@
-finnw            abYJdrr7ZKyI2          K v:ÿÿÿÿÿÿÿÿ                                                                                                                                                                                                                                                                   Finn Wilcox                    finnw at iname.com                                              q  K v: Nothing in rs                                                                                     FireFury         abAuwgDX6oL8I          
-–Fÿÿÿÿÿÿÿÿ                                                                                                                                                                                                                                                                   fish  ilcox                    foo  @iname.com                                              Ñ   
-–F Nothing in rs                                                                                   steve            abAuwgDX6oL8I          –Fÿÿÿÿÿÿÿÿ                                                                                                                                                                                                                                                                   foo   ilcox                    bar  @iname.com                                              ™   –F Nothing User FireFury                                                                           
\ No newline at end of file





More information about the mw-devel mailing list