From 87ac3207fbc12e3f186f338b36012d1ee40e90c1 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 26 Aug 2007 08:59:08 +0000 Subject: [PATCH] Don't include . No longer needed. --- src/buffer.c | 13 ++++++------- src/incremen.c | 17 ++++++++--------- src/system.c | 21 ++++++++++----------- src/tar.c | 25 ++++++++++++------------- 4 files changed, 36 insertions(+), 40 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index cea5f25..f99dcca 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -26,7 +26,6 @@ #include #include -#include #include #include @@ -591,7 +590,7 @@ _open_archive (enum access_mode wanted_access) } static void -do_checkpoint (bool write) +do_checkpoint (bool do_write) { if (checkpoint_option && !(++checkpoint % checkpoint_option)) { @@ -603,7 +602,7 @@ do_checkpoint (bool write) break; case checkpoint_text: - if (write) + if (do_write) /* TRANSLATORS: This is a ``checkpoint of write operation'', *not* ``Writing a checkpoint''. E.g. in Spanish ``Punto de comprobaci@'on de escritura'', @@ -1137,22 +1136,22 @@ try_new_volume () { size_t status; union block *header; - int access; + enum access_mode acc; switch (subcommand_option) { case APPEND_SUBCOMMAND: case CAT_SUBCOMMAND: case UPDATE_SUBCOMMAND: - access = ACCESS_UPDATE; + acc = ACCESS_UPDATE; break; default: - access = ACCESS_READ; + acc = ACCESS_READ; break; } - if (!new_volume (access)) + if (!new_volume (acc)) return true; while ((status = rmtread (archive, record_start->buffer, record_size)) diff --git a/src/incremen.c b/src/incremen.c index 4400008..372e11b 100644 --- a/src/incremen.c +++ b/src/incremen.c @@ -18,7 +18,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include -#include #include #include #include "common.h" @@ -455,9 +454,9 @@ makedumpdir (struct directory *directory, const char *dir) /* Recursively scan the given directory. */ static char * -scan_directory (char *dir_name, dev_t device) +scan_directory (char *dir, dev_t device) { - char *dirp = savedir (dir_name); /* for scanning directory */ + char *dirp = savedir (dir); /* for scanning directory */ char *name_buffer; /* directory, `/', and directory member */ size_t name_buffer_size; /* allocated size of name_buffer, minus 2 */ size_t name_length; /* used length in name_buffer */ @@ -465,12 +464,12 @@ scan_directory (char *dir_name, dev_t device) struct directory *directory; if (! dirp) - savedir_error (dir_name); + savedir_error (dir); - name_buffer_size = strlen (dir_name) + NAME_FIELD_SIZE; + name_buffer_size = strlen (dir) + NAME_FIELD_SIZE; name_buffer = xmalloc (name_buffer_size + 2); - strcpy (name_buffer, dir_name); - if (! ISSLASH (dir_name[strlen (dir_name) - 1])) + strcpy (name_buffer, dir); + if (! ISSLASH (dir[strlen (dir) - 1])) strcat (name_buffer, "/"); name_length = strlen (name_buffer); @@ -552,9 +551,9 @@ scan_directory (char *dir_name, dev_t device) } char * -get_directory_contents (char *dir_name, dev_t device) +get_directory_contents (char *dir, dev_t device) { - return scan_directory (dir_name, device); + return scan_directory (dir, device); } diff --git a/src/system.c b/src/system.c index 6634939..ba1d191 100644 --- a/src/system.c +++ b/src/system.c @@ -17,7 +17,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include -#include #include #include "common.h" @@ -697,7 +696,7 @@ stat_to_env (char *name, char type, struct tar_stat_info *st) } } -static pid_t pid; +static pid_t global_pid; static RETSIGTYPE (*pipe_handler) (int sig); int @@ -708,9 +707,9 @@ sys_exec_command (char *file_name, int typechar, struct tar_stat_info *st) xpipe (p); pipe_handler = signal (SIGPIPE, SIG_IGN); - pid = xfork (); + global_pid = xfork (); - if (pid != 0) + if (global_pid != 0) { xclose (p[PREAD]); return p[PWRITE]; @@ -737,14 +736,14 @@ sys_wait_command (void) { int status; - if (pid < 0) + if (global_pid < 0) return; signal (SIGPIPE, pipe_handler); - while (waitpid (pid, &status, 0) == -1) + while (waitpid (global_pid, &status, 0) == -1) if (errno != EINTR) { - pid = -1; + global_pid = -1; waitpid_error (to_command_option); return; } @@ -753,18 +752,18 @@ sys_wait_command (void) { if (!ignore_command_error_option && WEXITSTATUS (status)) ERROR ((0, 0, _("%lu: Child returned status %d"), - (unsigned long) pid, WEXITSTATUS (status))); + (unsigned long) global_pid, WEXITSTATUS (status))); } else if (WIFSIGNALED (status)) { WARN ((0, 0, _("%lu: Child terminated on signal %d"), - (unsigned long) pid, WTERMSIG (status))); + (unsigned long) global_pid, WTERMSIG (status))); } else ERROR ((0, 0, _("%lu: Child terminated on unknown reason"), - (unsigned long) pid)); + (unsigned long) global_pid)); - pid = -1; + global_pid = -1; } int diff --git a/src/tar.c b/src/tar.c index b460211..f16d620 100644 --- a/src/tar.c +++ b/src/tar.c @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -1934,23 +1933,23 @@ usage (int status) /* Parse the options for tar. */ static struct argp_option * -find_argp_option (struct argp_option *options, int letter) +find_argp_option (struct argp_option *o, int letter) { for (; - !(options->name == NULL - && options->key == 0 - && options->arg == 0 - && options->flags == 0 - && options->doc == NULL); options++) - if (options->key == letter) - return options; + !(o->name == NULL + && o->key == 0 + && o->arg == 0 + && o->flags == 0 + && o->doc == NULL); o++) + if (o->key == letter) + return o; return NULL; } static void decode_options (int argc, char **argv) { - int index; + int idx; struct tar_args args; /* Set some default option values. */ @@ -2041,7 +2040,7 @@ decode_options (int argc, char **argv) prepend_default_options (getenv ("TAR_OPTIONS"), &argc, &argv); if (argp_parse (&argp, argc, argv, ARGP_IN_ORDER|ARGP_NO_HELP, - &index, &args)) + &idx, &args)) exit (TAREXIT_FAILURE); @@ -2069,9 +2068,9 @@ decode_options (int argc, char **argv) } /* Handle operands after any "--" argument. */ - for (; index < argc; index++) + for (; idx < argc; idx++) { - name_add_name (argv[index], MAKE_INCL_OPTIONS (&args)); + name_add_name (argv[idx], MAKE_INCL_OPTIONS (&args)); args.input_files = true; } -- 2.45.2