summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-01-21 22:49:09 +0000
committerJim Meyering <jim@meyering.net>2004-01-21 22:49:09 +0000
commit7e85d17815d4c75669cd56ba75d8ee64b1ea881b (patch)
tree7e69691697ddd35b754bfc7d62f53b058a5bd3c9 /src
parentd5f068d892c3961e86695fa507196f1e5792e24f (diff)
downloadcoreutils-7e85d17815d4c75669cd56ba75d8ee64b1ea881b.tar.xz
(usage): Use EXIT_SUCCESS, not 0, for clarity.
(exit_status): Remove static var.... (main): Making it local here instead. Use =, not |=, to set it.
Diffstat (limited to 'src')
-rw-r--r--src/cp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/cp.c b/src/cp.c
index 48ece6a89..89ec89cde 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -1,5 +1,5 @@
/* cp.c -- file copying (main routines)
- Copyright (C) 89, 90, 91, 1995-2003 Free Software Foundation.
+ Copyright (C) 89, 90, 91, 1995-2004 Free Software Foundation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -116,9 +116,6 @@ static int const reply_vals[] =
I_ALWAYS_YES, I_ALWAYS_NO, I_ASK_USER
};
-/* The error code to return to the system. */
-static int exit_status = 0;
-
static struct option const long_opts[] =
{
{"archive", no_argument, NULL, 'a'},
@@ -153,7 +150,7 @@ static struct option const long_opts[] =
void
usage (int status)
{
- if (status != 0)
+ if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
@@ -821,6 +818,7 @@ int
main (int argc, char **argv)
{
int c;
+ int exit_status;
int make_backups = 0;
char *backup_suffix_string;
char *version_control_string = NULL;
@@ -1046,7 +1044,7 @@ main (int argc, char **argv)
hash_init ();
- exit_status |= do_copy (argc - optind, argv + optind, target_directory, &x);
+ exit_status = do_copy (argc - optind, argv + optind, target_directory, &x);
forget_all ();