diff options
author | steve <steve@FreeBSD.org> | 1999-04-19 03:59:02 +0000 |
---|---|---|
committer | steve <steve@FreeBSD.org> | 1999-04-19 03:59:02 +0000 |
commit | d59a3ca336bac3dac6ad8918ff6cb28fcbbba718 (patch) | |
tree | c2b57d23128f242645f8e3e16274a587229383ec /games/canfield | |
parent | 390eb1b3d201760a5e8b76e2431c1f667648718f (diff) | |
download | FreeBSD-src-d59a3ca336bac3dac6ad8918ff6cb28fcbbba718.zip FreeBSD-src-d59a3ca336bac3dac6ad8918ff6cb28fcbbba718.tar.gz |
Merge a bunch of cleanups from NetBSD.
PR: 8083
Submitted by: Stephen J. Roznowski <sjr@home.net>
Obtained from: a whole slew of NetBSD PRs
Diffstat (limited to 'games/canfield')
-rw-r--r-- | games/canfield/canfield/canfield.c | 13 | ||||
-rw-r--r-- | games/canfield/cfscores/cfscores.c | 6 |
2 files changed, 10 insertions, 9 deletions
diff --git a/games/canfield/canfield/canfield.c b/games/canfield/canfield/canfield.c index a9a9a17..728e7fc 100644 --- a/games/canfield/canfield/canfield.c +++ b/games/canfield/canfield/canfield.c @@ -61,6 +61,7 @@ static char sccsid[] = "@(#)canfield.c 8.1 (Berkeley) 5/31/93"; #include <unistd.h> #include <stdlib.h> #include <string.h> +#include <fcntl.h> #include "pathnames.h" @@ -1325,7 +1326,7 @@ suspend() move(21, 0); refresh(); if (dbfd != -1) { - lseek(dbfd, uid * sizeof(struct betinfo), 0); + lseek(dbfd, uid * sizeof(struct betinfo), SEEK_SET); write(dbfd, (char *)&total, sizeof(total)); } kill(getpid(), SIGTSTP); @@ -1577,7 +1578,7 @@ initall() initdeck(deck); uid = getuid(); - i = lseek(dbfd, uid * sizeof(struct betinfo), 0); + i = lseek(dbfd, uid * sizeof(struct betinfo), SEEK_SET); if (i < 0) { close(dbfd); dbfd = -1; @@ -1640,7 +1641,7 @@ cleanup() status = NOBOX; updatebettinginfo(); if (dbfd != -1) { - lseek(dbfd, uid * sizeof(struct betinfo), 0); + lseek(dbfd, uid * sizeof(struct betinfo), SEEK_SET); write(dbfd, (char *)&total, sizeof(total)); close(dbfd); } @@ -1672,11 +1673,9 @@ askquit() /* * Can you tell that this used to be a Pascal program? */ -main(argc, argv) - int argc; - char *argv[]; +main() { - dbfd = open(_PATH_SCORE, 2); + dbfd = open(_PATH_SCORE, O_RDWR); /* revoke */ setgid(getgid()); diff --git a/games/canfield/cfscores/cfscores.c b/games/canfield/cfscores/cfscores.c index fb7a090..9488e81 100644 --- a/games/canfield/cfscores/cfscores.c +++ b/games/canfield/cfscores/cfscores.c @@ -43,6 +43,8 @@ static char sccsid[] = "@(#)cfscores.c 8.1 (Berkeley) 5/31/93"; #include <sys/types.h> #include <pwd.h> +#include <fcntl.h> +#include <unistd.h> #include "pathnames.h" struct betinfo { @@ -69,7 +71,7 @@ main(argc, argv) printf("Usage: cfscores [user]\n"); exit(1); } - dbfd = open(_PATH_SCORE, 0); + dbfd = open(_PATH_SCORE, O_RDONLY); if (dbfd < 0) { perror(_PATH_SCORE); exit(2); @@ -114,7 +116,7 @@ printuser(pw, printfail) printf("Bad uid %d\n", pw->pw_uid); return; } - i = lseek(dbfd, pw->pw_uid * sizeof(struct betinfo), 0); + i = lseek(dbfd, pw->pw_uid * sizeof(struct betinfo), SEEK_SET); if (i < 0) { perror("lseek"); return; |