mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
(usage): Use EXIT_SUCCESS, not 0, for clarity.
(exit_status): Remove static var.... (main): Making it local here instead. Use =, not |=, to set it.
This commit is contained in:
1 parent
d5f068d892
commit
7e85d17815
1 file changed
+4
-6
@@ -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 ();
|
||||
|
||||
|
||||
Reference in new issue
Block a user