summaryrefslogtreecommitdiff
path: root/games/robots
AgeCommit message (Collapse)Author
2023-10-10Fix format string warning in robots/score.cTheo Buehler
2022-12-04userspace: remove vestigial '?' cases from top-level getopt(3) loopsScott Soule Cheloha
getopt(3) returns '?' when it encounters a flag not present in the in the optstring or if a flag is missing its option argument. We can handle this case with the "default" failure case with no loss of legibility. Hence, remove all the redundant "case '?':" lines. Prompted by dlg@. With help from dlg@ and millert@. Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2 ok naddy@ millert@ dlg@
2021-10-23if both stdout and stderr are redirected to a non-tty, pledge(2) will killRicardo Mestre
ncurses applications, e.g.: /usr/games/worms 2>&1 | cat solve this by only calling pledge(2) after initscr(3) is set and done, or whatever function that calls it. since pledge(2) is called later now the promises might be reduced, but this a diff for another day. found by naddy@ almost a year ago, discussed with him deraadt@ and tb@ ok tb@
2020-02-14no need to declare "extern optarg" and "extern optind"Ingo Schwarze
when <unistd.h> is included; patch from Jan Stary <hans at stare dot cz>; OK millert
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
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.
2019-02-26g/c unused robots_roll file.Theo Buehler
From Randy Hartman
2018-08-23reduce pledge(2) to "stdio tty" after ncurses initialization. robots(6) uses aRicardo Mestre
scorefile nevertheless an fd is opened way in advance and therefore we can disable any further access to the filesystem. OK tb@
2017-05-28remove some escapes that are unnecessary/harmful. ok jmc schwarzeTed Unangst
2017-05-28remove unused macroTed Unangst
2017-05-28there are no bugs; i fixed themTed Unangst
2017-05-28if your dying scream would escape the death field, realign to stay withinTed Unangst
2017-05-28high scores printed too far to the right, move it left a littleTed Unangst
2016-08-27Pull in <sys/time.h> for struct timespec, gettimeofday(), clock_gettime(),Philip Guenther
and setitimer() ok deraadt@
2016-03-07- General changes:mestre
- 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
2016-01-07Some basic code maintenance in games/tb
- 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-04More cleanup and sorting on header sectionmestre
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
2015-12-26Set as __dead a few more functions, that don't return, on games/mestre
With precious tip, help and also OK from tb@
2015-12-25Declare usage() functions as __dead void, if they don't return, on games ↵mestre
section. Found another one in arithmetic(6) which also didn't return, and removed a function from number(6) which is not used anymore. OK tb@
2015-12-04put FILES into a similar format as ENVIRONMENT;Jason McIntyre
2015-12-04Drop pledge("getpw") and pwd.h and use the now usualtb
LOGNAME -> USER -> getlogin() -> ??? fallback in the score file, as requested by tedu@ Man page bits adapted from jmc@'s tweaks to snake.6
2015-11-29Move scorefile to $HOME. The nice implementation of the score filetb
depends on getpwuid(), so add "getpw" to the rest of the required pledges: "stdio rpath wpath cpath tty".
2015-11-24In 1995, all of the games were setuid games. At end of 1996, I took them allTheo de Raadt
to setgid games, and we started wittling them down. Nearly 10 years later I am removing all setgid from the games. If any of these have score files they are now broken, and I hope various folk repair them. I have argued for years (and received pushback...) that the score file features must be removed, or rewritten to use private files, because setgid is the wrong tool. ok tedu
2015-08-26Improve robots(6) by using timespec*() functions, replacing gettimeofday()Rafael Zalamena
with clock_gettime(MONOTONIC) to avoid clock changes and replacing poll() with ppoll() to deal better with timespec. ok guenther@.
2014-11-16Eliminate pointless use of <sys/param.h>, <sys/file.h>, <sys/sockio.h>,Philip Guenther
and <sys/ttydefaults.h> Replace MAXPATHLEN with PATH_MAX and MAXLOGNAME with LOGIN_NAME_MAX Pull in <limits.h> where needed Prefer sizeof(var) over MAXFOO or FOO_MAX ok deraadt@
2014-11-03select() to poll() conversionsTheo de Raadt
ok tedu (... other games maintainer absent)
2014-09-08obvious cases of missing .An;Ingo Schwarze
found with the new mandoc(1) MANDOCERR_AN_MISSING warning; no text changes
2013-08-29replace srandomdev()+random() with the arc4random*() familyChristian Weisgerber
tweaks and ok millert@, ok deraadt@
2009-10-28rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andTheo de Raadt
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
2007-05-31convert to new .Dd format;Jason McIntyre
2005-05-01use setresgid() to drop privs, it is simply a better and less ambiguous API;Damien Miller
ok deraadt@ and millert@ a while ago, more to come
2005-04-10sort options + sync usage();Jason McIntyre
2004-11-29ansi. ok deraadt@Jonathan Gray
2003-06-03Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2002-12-06Replace things like srandom(time(NULL)) with srandomdev(3). random(3)Todd C. Miller
good enough for games but we should at least use a decent seed. pjanzen@ OK
2002-05-31crmode -> cbreakPaul Janzen
2002-05-31de-registerPaul Janzen
2002-05-31No dm -> games with high score files etc. must explicitly be setgid games.Paul Janzen
2002-05-23The troll strikes.. The troll strikes.. The dungeon master ↵Theo de Raadt
dies.distrib/sets/lists
2002-02-16Part one of userland __P removal. Done with a simple regexp with some minor ↵Todd C. Miller
hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
2001-11-17section consistency: AUTHOR -> AUTHORS, even if only one listed;Paul Janzen
mpech@prosoft.org.lv
2001-08-18FormattingPaul Janzen
2001-08-12Nothing but comments after #endif; heko@Paul Janzen
2001-08-06Nothing but comments after #endif and #else; heko@iki.fiPaul Janzen
2001-06-06reorder sections, minor tidying; mpech@prosoft.org.lvPaul Janzen
2000-07-23Handle EOF on stdin.Paul Janzen
2000-01-21Remove unused function; jsm@netbsd.orgPaul Janzen
1999-12-18Enable realtime mode, use native curses functions when available, tidy manPaul Janzen
page, and use MAXLOGNAME for scorefile (this makes new scorefiles incompatible with old ones). Realtime idea and some code from d@.
1999-07-09- remove all trailing whitespaceAaron Campbell
* except when it is escaped with a `\' at the end of the line - fix remaining .Nm usage as well - this is from a patch I received from kwesterback@home.com, who has been working on some scripts for fixing formatting errors in mdoc'd man pages Ok, so there could be a cost/benefit debate with this commit, but since I have the patch we might as well commit it...
1998-12-15Always provide an argument to .Nm in SYNOPSIS sectionPaul Janzen
1998-11-29Don't capitalize game names at the beginning of sentences.Paul Janzen