summaryrefslogtreecommitdiffstats
path: root/games/robots/main.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* no need to declare "extern optarg" and "extern optind"schwarze2020-02-141-2/+1
| | | | | | when <unistd.h> is included; patch from Jan Stary <hans at stare dot cz>; OK millert
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-3/+3
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* reduce pledge(2) to "stdio tty" after ncurses initialization. robots(6) uses amestre2018-08-231-1/+5
| | | | | | | scorefile nevertheless an fd is opened way in advance and therefore we can disable any further access to the filesystem. OK tb@
* if your dying scream would escape the death field, realign to stay withintedu2017-05-281-2/+5
|
* - General changes:mestre2016-03-071-2/+2
| | | | | | | | | | | | - Remove -? from getopt(3) options, but still keep (or add) -h where applicable - Replace hardcoded program strings by getprogname(3) - Specific changes: - atc(6): this used -? and -u for usage(), remove both from game and manpage - bcd(6): use __progname instead of getprogname(3), no need to include stdlib.h - hunt(6): replace fputs(3) by fprintf(3) OK tb@ after his suggestions
* Some basic code maintenance in games/tb2016-01-071-3/+2
| | | | | | | | | | - 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@
* More cleanup and sorting on header sectionmestre2016-01-041-2/+10
| | | | | 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
* Drop pledge("getpw") and pwd.h and use the now usualtb2015-12-041-2/+2
| | | | | | | LOGNAME -> USER -> getlogin() -> ??? fallback in the score file, as requested by tedu@ Man page bits adapted from jmc@'s tweaks to snake.6
* Move scorefile to $HOME. The nice implementation of the score filetb2015-11-291-10/+21
| | | | | depends on getpwuid(), so add "getpw" to the rest of the required pledges: "stdio rpath wpath cpath tty".
* Improve robots(6) by using timespec*() functions, replacing gettimeofday()rzalamena2015-08-261-2/+1
| | | | | | | with clock_gettime(MONOTONIC) to avoid clock changes and replacing poll() with ppoll() to deal better with timespec. ok guenther@.
* select() to poll() conversionsderaadt2014-11-031-2/+1
| | | | ok tedu (... other games maintainer absent)
* replace srandomdev()+random() with the arc4random*() familynaddy2013-08-291-2/+1
| | | | tweaks and ok millert@, ok deraadt@
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-15/+1
| | | | | | | 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
* use setresgid() to drop privs, it is simply a better and less ambiguous API;djm2005-05-011-5/+6
| | | | ok deraadt@ and millert@ a while ago, more to come
* sort options + sync usage();jmc2005-04-101-3/+3
|
* ansi. ok deraadt@jsg2004-11-291-9/+6
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-031-7/+3
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Replace things like srandom(time(NULL)) with srandomdev(3). random(3)millert2002-12-061-3/+3
| | | | | good enough for games but we should at least use a decent seed. pjanzen@ OK
* crmode -> cbreakpjanzen2002-05-311-3/+3
|
* de-registerpjanzen2002-05-311-5/+5
|
* Remove unused function; jsm@netbsd.orgpjanzen2000-01-211-9/+2
|
* Enable realtime mode, use native curses functions when available, tidy manpjanzen1999-12-181-54/+63
| | | | | page, and use MAXLOGNAME for scorefile (this makes new scorefiles incompatible with old ones). Realtime idea and some code from d@.
* More largely NetBSD-inspired code cleanuppjanzen1998-08-221-17/+12
|
* Scorefile bugfix and minor code cleaning, some from NetBSDpjanzen1998-07-091-44/+41
|
* add tags to changed fileskstailey1997-02-051-0/+1
|
* fix highscore without breaking securitykstailey1997-02-051-1/+16
|
* r?index -> strr?chrmillert1997-01-171-1/+1
|
* proper gid revokederaadt1996-12-221-2/+4
|
* initial import of NetBSD treederaadt1995-10-181-0/+199