Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games/snake/snake snake: Avoid creating definitions prefixed...
details: https://anonhg.NetBSD.org/src/rev/762b753210d6
branches: trunk
changeset: 379120:762b753210d6
user: nia <nia%NetBSD.org@localhost>
date: Wed May 12 11:08:31 2021 +0000
description:
snake: Avoid creating definitions prefixed with _ inside a program
diffstat:
games/snake/snake/pathnames.h | 6 +++---
games/snake/snake/snake.c | 12 ++++++------
2 files changed, 9 insertions(+), 9 deletions(-)
diffs (55 lines):
diff -r 78f362ee6359 -r 762b753210d6 games/snake/snake/pathnames.h
--- a/games/snake/snake/pathnames.h Wed May 12 10:16:12 2021 +0000
+++ b/games/snake/snake/pathnames.h Wed May 12 11:08:31 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pathnames.h,v 1.4 2003/08/07 09:37:45 agc Exp $ */
+/* $NetBSD: pathnames.h,v 1.5 2021/05/12 11:08:31 nia Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -31,5 +31,5 @@
* @(#)pathnames.h 8.1 (Berkeley) 5/31/93
*/
-#define _PATH_RAWSCORES "/var/games/snakerawscores"
-#define _PATH_LOGFILE "/var/games/snake.log"
+#define SNAKE_PATH_RAWSCORES "/var/games/snakerawscores"
+#define SNAKE_PATH_LOGFILE "/var/games/snake.log"
diff -r 78f362ee6359 -r 762b753210d6 games/snake/snake/snake.c
--- a/games/snake/snake/snake.c Wed May 12 10:16:12 2021 +0000
+++ b/games/snake/snake/snake.c Wed May 12 11:08:31 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: snake.c,v 1.30 2020/05/14 08:34:18 msaitoh Exp $ */
+/* $NetBSD: snake.c,v 1.31 2021/05/12 11:08:31 nia Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)snake.c 8.2 (Berkeley) 1/7/94";
#else
-__RCSID("$NetBSD: snake.c,v 1.30 2020/05/14 08:34:18 msaitoh Exp $");
+__RCSID("$NetBSD: snake.c,v 1.31 2021/05/12 11:08:31 nia Exp $");
#endif
#endif /* not lint */
@@ -143,15 +143,15 @@ main(int argc, char **argv)
time_t tv;
/* Open score files then revoke setgid privileges */
- rawscores = open(_PATH_RAWSCORES, O_RDWR|O_CREAT, 0664);
+ rawscores = open(SNAKE_PATH_RAWSCORES, O_RDWR|O_CREAT, 0664);
if (rawscores < 0) {
- warn("open %s", _PATH_RAWSCORES);
+ warn("open %s", SNAKE_PATH_RAWSCORES);
sleep(2);
} else if (rawscores < 3)
exit(1);
- logfile = fopen(_PATH_LOGFILE, "a");
+ logfile = fopen(SNAKE_PATH_LOGFILE, "a");
if (logfile == NULL) {
- warn("fopen %s", _PATH_LOGFILE);
+ warn("fopen %s", SNAKE_PATH_LOGFILE);
sleep(2);
}
setgid(getgid());
Home |
Main Index |
Thread Index |
Old Index