diff options
author | dholland <dholland@NetBSD.org> | 2009-03-14 23:47:18 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2009-03-14 23:47:18 +0000 |
commit | 1c42ea16f8f04f01d757035d69494da12b19bb69 (patch) | |
tree | de4fdd6b14851ebdb5fc367ef364f4915c991de7 /sail/main.c | |
parent | 46d82f438f3ef522450f4282d4f9824144e3e538 (diff) | |
download | bsdgames-darwin-1c42ea16f8f04f01d757035d69494da12b19bb69.tar.gz bsdgames-darwin-1c42ea16f8f04f01d757035d69494da12b19bb69.tar.zst bsdgames-darwin-1c42ea16f8f04f01d757035d69494da12b19bb69.zip |
chdir to /var/games/sail while running, to simplify name handling.
Diffstat (limited to 'sail/main.c')
-rw-r--r-- | sail/main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sail/main.c b/sail/main.c index 221a9def..f7911b64 100644 --- a/sail/main.c +++ b/sail/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.23 2009/03/02 06:54:01 dholland Exp $ */ +/* $NetBSD: main.c,v 1.24 2009/03/14 23:47:18 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\ #if 0 static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: main.c,v 1.23 2009/03/02 06:54:01 dholland Exp $"); +__RCSID("$NetBSD: main.c,v 1.24 2009/03/14 23:47:18 dholland Exp $"); #endif #endif /* not lint */ @@ -52,6 +52,7 @@ __RCSID("$NetBSD: main.c,v 1.23 2009/03/02 06:54:01 dholland Exp $"); #include <time.h> #include <unistd.h> #include "extern.h" +#include "pathnames.h" #include "restart.h" int @@ -70,6 +71,10 @@ main(int argc, char **argv) exit(1); close(fd); + if (chdir(_PATH_SAILDIR) < 0) { + err(1, "%s", _PATH_SAILDIR); + } + srandom((u_long)time(NULL)); if ((p = strrchr(*argv, '/')) != NULL) |