diff options
| author | hubertf <hubertf@NetBSD.org> | 1998-08-29 22:53:03 +0000 |
|---|---|---|
| committer | hubertf <hubertf@NetBSD.org> | 1998-08-29 22:53:03 +0000 |
| commit | 767fe0a0b45f5df3e6cbe04473f9de1dfabc3369 (patch) | |
| tree | b532434458be7b7a83d2149e9285c614bcab8bba /games/backgammon/common_source/save.c | |
| parent | 61cf67759aaf9bd7cc0315ff6af9af5f84282e63 (diff) | |
Use symbolic names for signals(!), open(2)-constants, ...
Fix applied as per PR 6058 by Joseph Myers <jsm28@cam.ac.uk>
Diffstat (limited to 'games/backgammon/common_source/save.c')
| -rw-r--r-- | games/backgammon/common_source/save.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/games/backgammon/common_source/save.c b/games/backgammon/common_source/save.c index 5fd48f4681e..8faec03d166 100644 --- a/games/backgammon/common_source/save.c +++ b/games/backgammon/common_source/save.c @@ -1,4 +1,4 @@ -/* $NetBSD: save.c,v 1.5 1997/10/10 08:59:48 lukem Exp $ */ +/* $NetBSD: save.c,v 1.6 1998/08/29 22:53:04 hubertf Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,13 +38,13 @@ #if 0 static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: save.c,v 1.5 1997/10/10 08:59:48 lukem Exp $"); +__RCSID("$NetBSD: save.c,v 1.6 1998/08/29 22:53:04 hubertf Exp $"); #endif #endif /* not lint */ -#include "back.h" +#include <errno.h> -extern int errno; +#include "back.h" static char confirm[] = "Are you sure you want to leave now?"; static char prompt[] = "Enter a file name: "; @@ -94,7 +94,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, 0700)) != -1) break; } @@ -154,7 +154,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); |
