Move under HIDEGAME, add revoke
Cleanup Convert to random()
This commit is contained in:
parent
3cf3c55356
commit
6f55e94584
@ -1,8 +1,9 @@
|
||||
# $Id$
|
||||
# $Id: Makefile,v 1.3 1997/02/22 14:46:48 peter Exp $
|
||||
|
||||
PROG= bs
|
||||
MAN6= bs.6
|
||||
DPADD= ${LIBNCURSES} ${LIBMYTINFO}
|
||||
LDADD= -lncurses -lmytinfo
|
||||
HIDEGAME=hidegame
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -11,6 +11,10 @@
|
||||
#include <signal.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef A_UNDERLINE /* BSD curses */
|
||||
#define beep() write(1,"\007",1);
|
||||
@ -21,25 +25,6 @@
|
||||
#define strchr index
|
||||
#endif /* !A_UNDERLINE */
|
||||
|
||||
#ifdef isxdigit /* aha, must be an AT&T system... */
|
||||
#define srand(n) srand48(n)
|
||||
#define rand() lrand48()
|
||||
extern long lrand48();
|
||||
extern void srand48();
|
||||
#define bzero(s, n) (void)memset((char *)(s), '\0', n)
|
||||
extern char *memset();
|
||||
/*
|
||||
* Try this if ungetch() fails to resolve.
|
||||
*
|
||||
* #define ungetch ungetc
|
||||
*/
|
||||
#endif /* isxdigit */
|
||||
|
||||
extern unsigned sleep();
|
||||
extern char *strchr(), *strcpy();
|
||||
extern long time();
|
||||
extern void exit();
|
||||
|
||||
static bool checkplace();
|
||||
|
||||
/*
|
||||
@ -203,7 +188,7 @@ static void intro()
|
||||
extern char *getlogin();
|
||||
char *tmpname;
|
||||
|
||||
srand(time(0L)+getpid()); /* Kick the random number generator */
|
||||
srandomdev();
|
||||
|
||||
(void) signal(SIGINT,uninitgame);
|
||||
(void) signal(SIGINT,uninitgame);
|
||||
@ -311,7 +296,7 @@ int vis;
|
||||
static int rnd(n)
|
||||
int n;
|
||||
{
|
||||
return(((rand() & 0x7FFF) % n));
|
||||
return(random() % n);
|
||||
}
|
||||
|
||||
static void randomplace(b, ss)
|
||||
@ -1202,6 +1187,9 @@ main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
/* revoke */
|
||||
setgid(getgid());
|
||||
|
||||
do_options(argc, argv);
|
||||
|
||||
intro();
|
||||
|
Loading…
Reference in New Issue
Block a user