diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 1998-08-29 23:19:13 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 1998-08-29 23:19:13 +0000 |
commit | e0f0fc164b9c4554dbca60b9c1df8c30d35598d7 (patch) | |
tree | a9316c29ee265dbad182830818e649ea82303e18 /games/backgammon/common_source/save.c | |
parent | 48adb27998c1144d802791e25c55bed63e44d7f1 (diff) |
use names rather than numbers in signals, errors, etc; NetBSD PR6058; jsm28@cam.ac.uk
Diffstat (limited to 'games/backgammon/common_source/save.c')
-rw-r--r-- | games/backgammon/common_source/save.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/games/backgammon/common_source/save.c b/games/backgammon/common_source/save.c index 6fbce3089c9..1c65c5dd33a 100644 --- a/games/backgammon/common_source/save.c +++ b/games/backgammon/common_source/save.c @@ -1,4 +1,4 @@ -/* $OpenBSD: save.c,v 1.3 1998/03/19 11:13:25 pjanzen Exp $ */ +/* $OpenBSD: save.c,v 1.4 1998/08/29 23:19:09 pjanzen Exp $ */ /* * Copyright (c) 1980, 1993 @@ -37,14 +37,13 @@ #if 0 static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: save.c,v 1.3 1998/03/19 11:13:25 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: save.c,v 1.4 1998/08/29 23:19:09 pjanzen Exp $"; #endif #endif /* not lint */ +#include <errno.h> #include "back.h" -extern int errno; - static char confirm[] = "Are you sure you want to leave now?"; static char prompt[] = "Enter a file name: "; static char exist1[] = "The file '"; @@ -93,7 +92,7 @@ save(n) writec(*fs++); } *fs = '\0'; - if ((fdesc = open(fname, 2)) == -1 && errno == 2) { + if ((fdesc = open(fname, O_RDWR)) == -1 && errno == ENOENT) { if ((fdesc = creat(fname, 0600)) != -1) break; } @@ -153,7 +152,7 @@ recover(s) { int fdesc; - if ((fdesc = open(s, 0)) == -1) + if ((fdesc = open(s, O_RDONLY)) == -1) norec(s); read(fdesc, board, sizeof(board)); read(fdesc, off, sizeof(off)); |