diff options
author | 2015-11-24 16:54:22 +0000 | |
---|---|---|
committer | 2015-11-24 16:54:22 +0000 | |
commit | e10665cf08a79674ca3ed46a712d1d7a6a4568be (patch) | |
tree | 1d773fd096023e0d6c19b378f54185b8625ceeee | |
parent | You need <netinet/ip.h> if you use "struct ip" for hw checksum. (diff) | |
download | wireguard-openbsd-e10665cf08a79674ca3ed46a712d1d7a6a4568be.tar.xz wireguard-openbsd-e10665cf08a79674ca3ed46a712d1d7a6a4568be.zip |
repair lseeks, from Ricardo
-rw-r--r-- | games/canfield/canfield/canfield.c | 12 | ||||
-rw-r--r-- | games/canfield/cfscores/cfscores.c | 7 |
2 files changed, 4 insertions, 15 deletions
diff --git a/games/canfield/canfield/canfield.c b/games/canfield/canfield/canfield.c index b9f1a814451..34c8ae9306e 100644 --- a/games/canfield/canfield/canfield.c +++ b/games/canfield/canfield/canfield.c @@ -1,4 +1,4 @@ -/* $OpenBSD: canfield.c,v 1.17 2015/11/24 02:53:39 tedu Exp $ */ +/* $OpenBSD: canfield.c,v 1.18 2015/11/24 16:54:22 tedu Exp $ */ /* $NetBSD: canfield.c,v 1.7 1995/05/13 07:28:35 jtc Exp $ */ /* @@ -1377,7 +1377,7 @@ suspend(void) move(21, 0); refresh(); if (dbfd != -1) { - lseek(dbfd, sizeof(struct betinfo), SEEK_SET); + lseek(dbfd, 0, SEEK_SET); write(dbfd, (char *)&total, sizeof(total)); } kill(getpid(), SIGTSTP); @@ -1635,12 +1635,6 @@ initall(void) dbfd = open(scorepath, O_RDWR | O_CREAT, 0644); if (dbfd < 0) return; - i = lseek(dbfd, sizeof(struct betinfo), SEEK_SET); - if (i < 0) { - close(dbfd); - dbfd = -1; - return; - } i = read(dbfd, (char *)&total, sizeof(total)); if (i < 0) { close(dbfd); @@ -1698,7 +1692,7 @@ cleanup(int dummy) status = NOBOX; updatebettinginfo(); if (dbfd != -1) { - lseek(dbfd, sizeof(struct betinfo), SEEK_SET); + lseek(dbfd, 0, SEEK_SET); write(dbfd, (char *)&total, sizeof(total)); close(dbfd); } diff --git a/games/canfield/cfscores/cfscores.c b/games/canfield/cfscores/cfscores.c index 39cfb5d5b1d..e91327a996b 100644 --- a/games/canfield/cfscores/cfscores.c +++ b/games/canfield/cfscores/cfscores.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cfscores.c,v 1.17 2015/11/24 02:53:39 tedu Exp $ */ +/* $OpenBSD: cfscores.c,v 1.18 2015/11/24 16:54:22 tedu Exp $ */ /* $NetBSD: cfscores.c,v 1.3 1995/03/21 15:08:37 cgd Exp $ */ /* @@ -91,11 +91,6 @@ printuser(const struct passwd *pw, int printfail) printf("Bad uid %u\n", pw->pw_uid); return; } - i = lseek(dbfd, sizeof(struct betinfo), SEEK_SET); - if (i < 0) { - warn("lseek %s", scorepath); - return; - } i = read(dbfd, (char *)&total, sizeof(total)); if (i < 0) { warn("lseek %s", scorepath); |