1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00
Commit Graph

39 Commits

Author SHA1 Message Date
mestre
b9f1292116 Remove a few too early pledge(2)s on games/ and apply them a little bit later
but with much reduced permissions ("stdio tty" if ncurses based and "stdio"
for the ones that only perform basic operations).

There's still a few games that we cannot yet remove their fs access, through
pledge(2), since they open files on demand and too late, this might get
revisited in the future.

OK tb@
2018-08-24 11:14:49 +00:00
tb
17641e3181 Some basic code maintenance in games/
- in main() replace exit with return
- drop some /* NOTREACHED */ lint comments along the way.
- make more use of standard CFLAGS, esp. -Wimplicit-function-declaration
- add and sort some headers when needed
- add straightforward pledges to some programs used at compile time

discussed with and ok mestre@
2016-01-07 16:00:31 +00:00
mestre
2010f3c835 More cleanup and sorting on header section
OK tb@ and he also pointed out that for consistency with rest of the tree we
should include termios.h instead of sys/ttydefaults.h, where applicable
2016-01-04 17:33:24 +00:00
mestre
9ea8ec706f About 13 years ago when the idiom srandom(time()), and sometimes
srandom(time()+getpid()), was changed by srandomdev(), but #include <time.h>
lived up until this day so remove it.

Additionally, earlier than that, 18 years ago, random(6) was one of the first
consumers of arc4random(3) family, and was pulling it from dev/rndvar.h but
these days we pull it from stdlib.h, which is already done, so while here
remove dev/rndvar.h also.

"seems comprehensive to me" deraadt@ and OK tb@
2016-01-03 14:38:16 +00:00
mestre
7ad55f5581 Set as __dead a few more functions, that don't return, on games/
With precious tip, help and also OK from tb@
2015-12-26 00:26:39 +00:00
deraadt
db911c4702 pledge the wyrms 2015-11-21 05:29:42 +00:00
tedu
33206277fe replace setbuf with setvbuf, from Frederic Nowak 2015-11-04 21:22:10 +00:00
rzalamena
d4bd758816 Replace clock_gettime UPTIME with MONOTONIC to improve worm portability.
ok deraadt@, guenther@.
2015-08-26 01:25:57 +00:00
rzalamena
df5f0d5ca1 Fix cheating bug by using unused time variables and replace poll() with
ppoll() to better use the timespec struct.

ok deraadt@.
2015-08-24 21:52:12 +00:00
deraadt
ca161728cb remove malloc/calloc/realloc* casts, due to stdlib.h being present; ok millert krw 2015-08-22 14:47:40 +00:00
deraadt
40ad53c423 KNF 2015-08-21 02:42:26 +00:00
tedu
943007379d make the worm grow faster on larger terminals. this is more fun than
starting with an enormous pile of worm at the start.
2015-03-09 19:52:02 +00:00
deraadt
5e64005729 select() to poll() conversions
ok tedu (... other games maintainer absent)
2014-11-03 22:14:54 +00:00
jmc
694ee1bce2 from pjanzen:
Start with the cursor on the worm's head.

ok millert
2014-01-28 14:30:28 +00:00
jmc
3c877182e5 from pjanzen:
Use strtonum() and error out on an unacceptable length argument rather than
reverting to default values; document maximum initial length limit.

started by a diff From: Jan Stary, who requested we document default behaviour

ok millert
2014-01-28 14:28:44 +00:00
naddy
66e4954187 replace srandomdev()+random() with the arc4random*() family
tweaks and ok millert@, ok deraadt@
2013-08-29 20:22:09 +00:00
deraadt
043fbe51c1 rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms
2009-10-27 23:59:19 +00:00
jsg
3eb8c9ed66 ansi. ok deraadt@ 2004-11-29 08:52:28 +00:00
millert
7a09557bd4 Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.
2003-06-03 03:01:37 +00:00
pjanzen
0f542f9d4c ANSI 2003-05-19 07:58:00 +00:00
pjanzen
ac54bff5ac volatile sig_atomic_t 2003-05-19 07:53:54 +00:00
millert
ffe3e52230 Replace things like srandom(time(NULL)) with srandomdev(3). random(3)
good enough for games but we should at least use a decent seed.
pjanzen@ OK
2002-12-06 21:48:50 +00:00
pjanzen
97419aa08e de-register 2002-05-31 04:21:20 +00:00
pjanzen
ef2c807a96 No dm -> no need to revoke setegid. 2002-05-31 03:39:55 +00:00
millert
c72b5b24e1 Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically. 2002-02-16 21:27:05 +00:00
deraadt
76ab7853de move gunk out of signal handlers, now safe 2001-11-17 08:21:44 +00:00
pjanzen
ab2b21cad8 Handle EOF on stdin. 2001-09-03 18:04:08 +00:00
pjanzen
51b60ce960 Fixes from NetBSD (jsm@), one reported by Malcolm Parsons
<malcolm@ivywell.screaming.net>:  don't hang if the worm occupies all the
space, fix off-by-one, and check for screen size.
2001-09-03 17:45:43 +00:00
pjanzen
82af4e5361 include <string.h> 2001-02-18 18:22:26 +00:00
pjanzen
ecb90f8a2b support arrow keys (cgd@netbsd.org); use select() rather than alarm() for
timing
2000-01-25 07:06:41 +00:00
hugh
ea33cce364 unbreak brake 1999-09-03 09:35:24 +00:00
pjanzen
a5f84b203d jsm28@cam.ac.uk: place cursor on player, not one over. 1999-04-20 23:01:12 +00:00
pjanzen
5f9f88f998 Make sure malloc() succeeds 1998-09-16 00:44:36 +00:00
pjanzen
1ed0e75d51 tags, formatting, ANSI-fication, prototypes, de-typos, and the occasional
initialization, removal of unused variable, or other minor fix.  Most
changes are from or inspired by NetBSD.
1998-08-19 07:39:48 +00:00
pjanzen
76db234ba3 OpenBSD ID (changed from NetBSD) 1998-03-12 09:09:05 +00:00
deraadt
6d5bb74f57 cleanup; pjanzen@foatdi.harvard.edu 1998-02-08 18:59:56 +00:00
deraadt
161033a189 proper gid revoke 1996-12-22 20:00:41 +00:00
deraadt
893fd100f3 setgid games, not setuid games. closes a neat set of holes 1996-12-19 22:19:48 +00:00
deraadt
df930be708 initial import of NetBSD tree 1995-10-18 08:37:01 +00:00