#include <closeout.h>
#include <fnmatch.h>
-#include <getline.h>
#include <human.h>
#include <quotearg.h>
}
static void
-do_checkpoint (bool write)
+do_checkpoint (bool do_write)
{
if (checkpoint_option && !(++checkpoint % checkpoint_option))
{
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'',
{
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))
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#include <system.h>
-#include <getline.h>
#include <hash.h>
#include <quotearg.h>
#include "common.h"
/* 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 */
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);
}
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);
}
\f
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#include <system.h>
-#include <getline.h>
#include <setenv.h>
#include "common.h"
}
}
-static pid_t pid;
+static pid_t global_pid;
static RETSIGTYPE (*pipe_handler) (int sig);
int
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];
{
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;
}
{
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
#include <system.h>
#include <fnmatch.h>
-#include <getline.h>
#include <argp.h>
#include <argp-namefrob.h>
#include <argp-fmtstream.h>
/* 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. */
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);
}
/* 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;
}