* lib/wordsplit.c (_wsplit_error): Mark with printf attribute.
(expvar): "Use" defstr to pacify GCC.
* src/system.c (xexec): Now _Noreturn, to pacify GCC.
(run_decompress_program): Add cast to pacify GCC.
(sys_exec_command, sys_exec_info_script, sys_exec_checkpoint_script):
Remove unused variables.
+static void __attribute__ ((__format__ (__printf__, 1, 2)))
_wsplt_error (const char *fmt, ...)
{
va_list ap;
_wsplt_error (const char *fmt, ...)
{
va_list ap;
/* FIXME: handle defstr */
/* FIXME: handle defstr */
if (value)
{
if (flg & _WSNF_QUOTE)
if (value)
{
if (flg & _WSNF_QUOTE)
-wordsplit_len (const char *command, size_t length, struct wordsplit *wsp,
+wordsplit_len (const char *command, size_t length, struct wordsplit *wsp,
#include <signal.h>
#include <wordsplit.h>
#include <signal.h>
#include <wordsplit.h>
xexec (const char *cmd)
{
struct wordsplit ws;
xexec (const char *cmd)
{
struct wordsplit ws;
int child_pipe[2];
pid_t grandchild_pid;
pid_t child_pid;
int child_pipe[2];
pid_t grandchild_pid;
pid_t child_pid;
xpipe (parent_pipe);
child_pid = xfork ();
xpipe (parent_pipe);
child_pid = xfork ();
ws.ws_env = (const char **) environ;
ws.ws_offs = 1;
ws.ws_env = (const char **) environ;
ws.ws_offs = 1;
for (p = first_decompress_program (&i); p; p = next_decompress_program (&i))
{
if (prog)
for (p = first_decompress_program (&i); p; p = next_decompress_program (&i))
{
if (prog)
wsflags |= WRDSF_REUSE;
memmove(ws.ws_wordv, ws.ws_wordv + ws.ws_offs,
sizeof(ws.ws_wordv[0])*ws.ws_wordc);
wsflags |= WRDSF_REUSE;
memmove(ws.ws_wordv, ws.ws_wordv + ws.ws_offs,
sizeof(ws.ws_wordv[0])*ws.ws_wordc);
- ws.ws_wordv[ws.ws_wordc] = "-d";
- prog = p;
+ ws.ws_wordv[ws.ws_wordc] = (char *) "-d";
+ prog = p;
execvp (ws.ws_wordv[0], ws.ws_wordv);
ws.ws_wordv[ws.ws_wordc] = NULL;
}
execvp (ws.ws_wordv[0], ws.ws_wordv);
ws.ws_wordv[ws.ws_wordc] = NULL;
}
sys_exec_command (char *file_name, int typechar, struct tar_stat_info *st)
{
int p[2];
sys_exec_command (char *file_name, int typechar, struct tar_stat_info *st)
{
int p[2];
xpipe (p);
pipe_handler = signal (SIGPIPE, SIG_IGN);
global_pid = xfork ();
xpipe (p);
pipe_handler = signal (SIGPIPE, SIG_IGN);
global_pid = xfork ();
sys_exec_info_script (const char **archive_name, int volume_number)
{
pid_t pid;
sys_exec_info_script (const char **archive_name, int volume_number)
{
pid_t pid;
char uintbuf[UINTMAX_STRSIZE_BOUND];
int p[2];
static RETSIGTYPE (*saved_handler) (int sig);
char uintbuf[UINTMAX_STRSIZE_BOUND];
int p[2];
static RETSIGTYPE (*saved_handler) (int sig);
archive_format_string (current_format == DEFAULT_FORMAT ?
archive_format : current_format), 1);
setenv ("TAR_FD", STRINGIFY_BIGINT (p[PWRITE], uintbuf), 1);
archive_format_string (current_format == DEFAULT_FORMAT ?
archive_format : current_format), 1);
setenv ("TAR_FD", STRINGIFY_BIGINT (p[PWRITE], uintbuf), 1);
xclose (p[PREAD]);
priv_set_restore_linkdir ();
xclose (p[PREAD]);
priv_set_restore_linkdir ();
int checkpoint_number)
{
pid_t pid;
int checkpoint_number)
{
pid_t pid;
char uintbuf[UINTMAX_STRSIZE_BOUND];
char uintbuf[UINTMAX_STRSIZE_BOUND];
pid = xfork ();
if (pid != 0)
pid = xfork ();
if (pid != 0)
setenv ("TAR_FORMAT",
archive_format_string (current_format == DEFAULT_FORMAT ?
archive_format : current_format), 1);
setenv ("TAR_FORMAT",
archive_format_string (current_format == DEFAULT_FORMAT ?
archive_format : current_format), 1);
- argv[0] = (char *) "/bin/sh";
- argv[1] = (char *) "-c";
- argv[2] = (char *) script_name;
- argv[3] = NULL;
-
priv_set_restore_linkdir ();
xexec (script_name);
}
priv_set_restore_linkdir ();
xexec (script_name);
}