1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-04 11:40:22 +00:00
Commit Graph

19 Commits

Author SHA1 Message Date
Thien-Thi Nguyen
65396510c3 Throughout, replace 0 destined for exit' arg with EXIT_SUCCESS'.
Likewise, replace 1 with `EXIT_FAILURE'.
(main): Use `EXIT_SUCCESS' or `EXIT_FAILURE' for return value.
2004-05-08 15:26:33 +00:00
Miles Bader
ab5796a9f9 Add arch taglines 2003-09-01 15:45:59 +00:00
Dave Love
1d28afaf27 (difftime) [!HAVE_DIFFTIME]: Define.
(strerror) [!HAVE_STRERROR && !WINDOWSNT]: New.
2003-05-22 20:01:19 +00:00
Juanma Barranquero
ee435bae30 (read_scores): Fix corruption of score files. 2003-04-27 11:22:16 +00:00
Juanma Barranquero
177c0ea743 Trailing whitespace deleted. 2003-02-04 14:56:31 +00:00
Richard M. Stallman
00a7e40898 (push_score, read_scores): Cast values of malloc and realloc.
(main, lock_file): Avoid assignment inside if.
2003-02-04 12:03:44 +00:00
Richard M. Stallman
a5d107f3c7 Whitespace changes. 2003-02-04 12:00:09 +00:00
Dave Love
5b400482b0 Include unistd.h, string.h, stdlib.h,
fcntl.h, stdarg.h conditionally.
(_GNU_SOURCE, __attribute__): Don't define.
(optarg, optind, opterr): Declare.
(lose, lose_syserr): Use NO_RETURN.
(get_user_id): Use P_.
2002-11-18 15:35:07 +00:00
Colin Walters
cf398788c7 (P_): New macro. Use it for all prototypes.
(lose): Don't use varargs.
(lose_syserr): New function.

Change all functions to K&R style.
2002-08-01 01:31:44 +00:00
Colin Walters
d99fabf003 (SCORE_FILE_PREFIX): Delete.
(main): New argument -d, for specifying directory.
(usage): Document.
(get_user_id): Compute
(get_home_dir): Deleted.
(get_prefix): New function, taken from main.
(main): Check whether or not we are running setuid.  Move prefix
computation to get_prefix.  Don't call getpwent; we don't need to
any more.  Instead, move it to get_user_id().
2002-04-29 22:49:00 +00:00
Colin Walters
1d4328ffce (read_score) [HAVE_GETDELIM]: Trim trailing space. 2002-04-23 20:23:05 +00:00
Eli Zaretskii
c42d6dbdbe Move config.h before the other headers, to prevent compiler warnings
due to redifinition of _FILE_OFFSET_BITS.
2002-04-16 20:05:08 +00:00
Colin Walters
7c4f687309 (lock_file): If the lock file is older than an hour, delete it. Reset
attempts to zero if we have to break the lock.
2002-04-14 06:40:19 +00:00
Andreas Schwab
7605f1bd6c (read_score): Fix type of second parameter
of getdelim to be of type size_t instead of int.  Use 0 instead of
ESUCCES.
2002-04-14 01:02:53 +00:00
Colin Walters
8eec804f6e (toplevel): Include stdarg.h.
(MAX_DATA_LEN, MAX_SCORES): New.
(SCORE_FILE_PREFIX): If HAVE_SHARED_GAME_DIR is not defined,
default to ~/.emacs.d/games.
(get_user_id): Don't zero uid in the case where we can't get the
username.
(lose): New function.
(main): Actually use `max', and default it to MAX_SCORES.
Correctly handle new default for SCORE_FILE_PREFIX.  Use `lose'
function.
(read_score): Handle the case of reading unamelen characters, then
finishing.  Use mktemp if mkstemp isn't available.
(lock_file, unlock_file): Delete unused versions.
(lock_file): Always sleep, even if we unlinked the lock file.
2002-04-10 19:10:23 +00:00
Colin Walters
5795b42089 update-game-score.c (SCORE_FILE_PREFIX): Don't hardcode.
(get_user_id): Take struct passwd as an argument.
(get_home_dir): New function.
(main): Read in user information here.  Discover home directory if
necessary.
(read_score): Trim newline only in `getline' case.
2002-04-07 05:46:15 +00:00
Colin Walters
f5bceaf89b Actually make previous changes work (oops). 2002-04-05 09:18:57 +00:00
Colin Walters
cd553ffbf3 (toplevel): Include pwd.h.
(struct score_entry): Add username field.
(push_score): Use it.
(get_user_id): New function.
(main): Don't malloc excessively.
(main): Use username field.
(read_score): Read it.
(push_score): Handle it.
(write_scores) Write it.
(read_score): Handle arbitrary length data.
2002-04-05 08:58:12 +00:00
Colin Walters
2f1de3dd26 Initial version. 2002-03-27 20:57:06 +00:00