From b5ca0e4da5f9e9439390a53e0d218c013a0b420e Mon Sep 17 00:00:00 2001 From: hubertf Date: Sat, 29 Aug 1998 22:47:56 +0000 Subject: Use symbolic constants for seek(), open(). Fixed as per PR 6057 by Joseph Myers . --- canfield/canfield/canfield.c | 12 ++++++------ canfield/cfscores/cfscores.c | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'canfield') 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)); -- cgit v1.2.3-56-ge451