summaryrefslogtreecommitdiff
path: root/lib/backupfile.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-11-10 05:57:56 +0000
committerJim Meyering <jim@meyering.net>1998-11-10 05:57:56 +0000
commit9e3f43b368d266688a6ce45be534a5bd6a629a57 (patch)
tree8c55f3498a5f6a4730b213ed6b45583d8b9e3d5b /lib/backupfile.c
parentd7b702d0d022ba5a83cd590b6766b32dcab6288d (diff)
downloadcoreutils-9e3f43b368d266688a6ce45be534a5bd6a629a57.tar.xz
[EXIT_FAILURE]: Define.
(get_version): Use EXIT_FAILURE as exit status rather than hard-coding `2'. From François Pinard.
Diffstat (limited to 'lib/backupfile.c')
-rw-r--r--lib/backupfile.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/backupfile.c b/lib/backupfile.c
index a1b05a123..a22a7f235 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];
}