From 95b7d7b9ddf02f9dee432106a630730de92c76b4 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 10 Nov 1998 05:57:56 +0000 Subject: [PATCH] =?utf8?q?[EXIT=5FFAILURE]:=20Define.=20(get=5Fversion):?= =?utf8?q?=20Use=20EXIT=5FFAILURE=20as=20exit=20status=20rather=20than=20h?= =?utf8?q?ard-coding=20`2'.=20=20From=20Fran=E7ois=20Pinard.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/backupfile.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/backupfile.c b/lib/backupfile.c index a1b05a1233..a22a7f235e 100644 --- a/lib/backupfile.c +++ b/lib/backupfile.c @@ -97,6 +97,14 @@ char *malloc (); # define REAL_DIR_ENTRY(dp) 1 #endif +/* The following test is to work around the gross typo in + systems like Sony NEWS-OS Release 4.0C, whereby EXIT_FAILURE + is defined to 0, not 1. */ +#if !EXIT_FAILURE +# undef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif + /* The extension added to file names to produce a simple (as opposed to numbered) backup file name. */ const char *simple_backup_suffix = "~"; @@ -212,7 +220,7 @@ version_number (const char *base, const char *backup, size_t base_length) } #endif /* HAVE_DIR */ -static const char * const backup_args[] = +static const char *const backup_args[] = { "never", "simple", "nil", "existing", "t", "numbered", 0 }; @@ -236,7 +244,7 @@ get_version (const char *version) if (i < 0) { invalid_arg ("version control type", version, i); - exit (2); + exit (EXIT_FAILURE); } return backup_types[i]; } -- 2.30.2