summaryrefslogtreecommitdiffstats
path: root/canfield
diff options
context:
space:
mode:
authorhubertf <hubertf@NetBSD.org>1998-08-29 22:47:56 +0000
committerhubertf <hubertf@NetBSD.org>1998-08-29 22:47:56 +0000
commitb5ca0e4da5f9e9439390a53e0d218c013a0b420e (patch)
tree45810b5eaee262e99dce8277d5fa8f2354a33517 /canfield
parent50b9d92da6d2a0b63fc8f263fe2736b71b3ebdd2 (diff)
downloadbsdgames-darwin-b5ca0e4da5f9e9439390a53e0d218c013a0b420e.tar.gz
bsdgames-darwin-b5ca0e4da5f9e9439390a53e0d218c013a0b420e.tar.zst
bsdgames-darwin-b5ca0e4da5f9e9439390a53e0d218c013a0b420e.zip
Use symbolic constants for seek(), open(). Fixed as per PR 6057 by
Joseph Myers <jsm@octomino.demon.co.uk>.
Diffstat (limited to 'canfield')
-rw-r--r--canfield/canfield/canfield.c12
-rw-r--r--canfield/cfscores/cfscores.c8
2 files changed, 10 insertions, 10 deletions
diff --git a/canfield/canfield/canfield.c b/canfield/canfield/canfield.c
index 0f684d39..d7861189 100644
--- a/canfield/canfield/canfield.c
+++ b/canfield/canfield/canfield.c
@@ -1,4 +1,4 @@
-/* $NetBSD: canfield.c,v 1.8 1997/10/10 12:26:39 lukem Exp $ */
+/* $NetBSD: canfield.c,v 1.9 1998/08/29 22:47:56 hubertf Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)canfield.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: canfield.c,v 1.8 1997/10/10 12:26:39 lukem Exp $");
+__RCSID("$NetBSD: canfield.c,v 1.9 1998/08/29 22:47:56 hubertf Exp $");
#endif
#endif /* not lint */
@@ -1427,7 +1427,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);
@@ -1682,10 +1682,10 @@ initall()
uid = getuid();
if (uid < 0)
uid = 0;
- dbfd = open(_PATH_SCORE, 2);
+ dbfd = open(_PATH_SCORE, O_RDWR);
if (dbfd < 0)
return;
- i = lseek(dbfd, uid * sizeof(struct betinfo), 0);
+ i = lseek(dbfd, uid * sizeof(struct betinfo), SEEK_SET);
if (i < 0) {
close(dbfd);
dbfd = -1;
@@ -1749,7 +1749,7 @@ cleanup(dummy)
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);
}
diff --git a/canfield/cfscores/cfscores.c b/canfield/cfscores/cfscores.c
index dd0fa93e..e5830fef 100644
--- a/canfield/cfscores/cfscores.c
+++ b/canfield/cfscores/cfscores.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cfscores.c,v 1.5 1997/10/11 02:41:45 lukem Exp $ */
+/* $NetBSD: cfscores.c,v 1.6 1998/08/29 22:47:57 hubertf Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0
static char sccsid[] = "@(#)cfscores.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: cfscores.c,v 1.5 1997/10/11 02:41:45 lukem Exp $");
+__RCSID("$NetBSD: cfscores.c,v 1.6 1998/08/29 22:47:57 hubertf Exp $");
#endif
#endif /* not lint */
@@ -83,7 +83,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)
err(2, "open %s", _PATH_SCORE);
setpwent();
@@ -126,7 +126,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)
warn("lseek %s", _PATH_SCORE);
i = read(dbfd, (char *)&total, sizeof(total));