freebsd-ports/games/wolfpack/files/patch-src::doconfig::doconfig.c
Joe Marcus Clarke 7720ae9358 * Update to 4.2.18 to fix a build problem with bind9 in the base system [1]
* Add an rc.d script and run as a separate user
* Fix MASTERDIR and pkg-descr URL

PR:		72484
		72469
Submitted by:	Daniel J. O'Connor <darius@dons.net.au> (maintainer)
Reported by:	pointyhat via kris [1]
Approved by:	portmgr (implicit)
2004-10-11 02:40:00 +00:00

61 lines
1.5 KiB
C

--- src/doconfig/doconfig.c.orig Tue Sep 7 23:52:37 2004
+++ src/doconfig/doconfig.c Sun Oct 10 11:31:04 2004
@@ -80,12 +80,17 @@
#endif
int
-main(void)
+main(int argc, char **argv)
{
char buf[256];
char *cp;
char *pathname;
+ if (argc != 2) {
+ printf("Bad usage");
+ exit(-1);
+ }
+
if ((pathname = safe_getcwd()) == NULL) {
printf("Can't get current path!\n");
exit(-1);
@@ -101,30 +106,16 @@
cp = strrchr(pathname, '\\');
*cp = '\0';
#endif
- printf("Configuring...\n");
- wrmakesrc(pathname);
- sprintf(buf, "%s/include/gamesdef.h", pathname);
- wrgamesdef(buf);
- sprintf(buf, "%s/src/client/ipglob.c", pathname);
- wripglob(buf);
-
- if (access(EP, 0)) {
- printf("making directory %s\n", EP);
- if (mkdir(EP, 0755)) {
- printf("mkdir failed on %s, exiting.\n", EP);
- exit(-1);
- }
- }
- sprintf(buf, "%s/data", EP);
- if (access(buf, 0)) {
- printf("making directory %s\n", buf);
- if (mkdir(buf, 0755)) {
- printf("mkdir failed on %s, exiting.\n", buf);
- exit(-1);
- }
+ if (!strcasecmp(argv[1], "config")) {
+ printf("Configuring...\n");
+ wrmakesrc(pathname);
+ sprintf(buf, "%s/include/gamesdef.h", pathname);
+ wrgamesdef(buf);
+ sprintf(buf, "%s/src/client/ipglob.c", pathname);
+ wripglob(buf);
+ sprintf(buf, "%s/data/auth", pathname);
+ wrauth(buf);
}
- sprintf(buf, "%s/data/auth", EP);
- wrauth(buf);
exit(0);
}