diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/update-game-score.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index 21309a3634a..7393135daa9 100644 --- a/lib-src/update-game-score.c +++ b/lib-src/update-game-score.c | |||
| @@ -29,30 +29,38 @@ Boston, MA 02111-1307, USA. */ | |||
| 29 | Created 2002/03/22, by Colin Walters <walters@debian.org> | 29 | Created 2002/03/22, by Colin Walters <walters@debian.org> |
| 30 | */ | 30 | */ |
| 31 | 31 | ||
| 32 | #define _GNU_SOURCE | ||
| 33 | |||
| 34 | #include <config.h> | 32 | #include <config.h> |
| 35 | 33 | ||
| 34 | #ifdef HAVE_UNISTD_H | ||
| 36 | #include <unistd.h> | 35 | #include <unistd.h> |
| 36 | #endif | ||
| 37 | #include <errno.h> | 37 | #include <errno.h> |
| 38 | #ifdef HAVE_STRING_H | ||
| 38 | #include <string.h> | 39 | #include <string.h> |
| 40 | #endif | ||
| 41 | #ifdef HAVE_STDLIB_H | ||
| 39 | #include <stdlib.h> | 42 | #include <stdlib.h> |
| 43 | #endif | ||
| 40 | #include <stdio.h> | 44 | #include <stdio.h> |
| 41 | #include <time.h> | 45 | #include <time.h> |
| 42 | #include <pwd.h> | 46 | #include <pwd.h> |
| 43 | #include <ctype.h> | 47 | #include <ctype.h> |
| 48 | #ifdef HAVE_FCNTL_H | ||
| 44 | #include <fcntl.h> | 49 | #include <fcntl.h> |
| 50 | #endif | ||
| 51 | #ifdef STDC_HEADERS | ||
| 45 | #include <stdarg.h> | 52 | #include <stdarg.h> |
| 53 | #endif | ||
| 46 | #include <sys/stat.h> | 54 | #include <sys/stat.h> |
| 47 | 55 | ||
| 56 | /* Needed for SunOS4, for instance. */ | ||
| 57 | extern char *optarg; | ||
| 58 | extern int optind, opterr; | ||
| 59 | |||
| 48 | #define MAX_ATTEMPTS 5 | 60 | #define MAX_ATTEMPTS 5 |
| 49 | #define MAX_SCORES 200 | 61 | #define MAX_SCORES 200 |
| 50 | #define MAX_DATA_LEN 1024 | 62 | #define MAX_DATA_LEN 1024 |
| 51 | 63 | ||
| 52 | #if !defined (__GNUC__) || __GNUC__ < 2 | ||
| 53 | #define __attribute__(x) | ||
| 54 | #endif | ||
| 55 | |||
| 56 | /* Declare the prototype for a general external function. */ | 64 | /* Declare the prototype for a general external function. */ |
| 57 | #if defined (PROTOTYPES) || defined (WINDOWSNT) | 65 | #if defined (PROTOTYPES) || defined (WINDOWSNT) |
| 58 | #define P_(proto) proto | 66 | #define P_(proto) proto |
| @@ -97,8 +105,7 @@ int | |||
| 97 | write_scores P_((const char *filename, const struct score_entry *scores, | 105 | write_scores P_((const char *filename, const struct score_entry *scores, |
| 98 | int count)); | 106 | int count)); |
| 99 | 107 | ||
| 100 | void lose P_((const char *msg)) | 108 | void lose P_((const char *msg)) NO_RETURN; |
| 101 | __attribute__ ((noreturn)); | ||
| 102 | 109 | ||
| 103 | void lose(msg) | 110 | void lose(msg) |
| 104 | const char *msg; | 111 | const char *msg; |
| @@ -107,8 +114,7 @@ void lose(msg) | |||
| 107 | exit(1); | 114 | exit(1); |
| 108 | } | 115 | } |
| 109 | 116 | ||
| 110 | void lose_syserr P_((const char *msg)) | 117 | void lose_syserr P_((const char *msg)) NO_RETURN; |
| 111 | __attribute__ ((noreturn)); | ||
| 112 | 118 | ||
| 113 | void lose_syserr(msg) | 119 | void lose_syserr(msg) |
| 114 | const char *msg; | 120 | const char *msg; |
| @@ -118,7 +124,7 @@ void lose_syserr(msg) | |||
| 118 | } | 124 | } |
| 119 | 125 | ||
| 120 | char * | 126 | char * |
| 121 | get_user_id(void) | 127 | get_user_id P_ ((void)) |
| 122 | { | 128 | { |
| 123 | char *name; | 129 | char *name; |
| 124 | struct passwd *buf = getpwuid(getuid()); | 130 | struct passwd *buf = getpwuid(getuid()); |