Lines 1-7
Link Here
|
1 |
/* System-dependent calls for tar. |
1 |
/* System-dependent calls for tar. |
2 |
|
2 |
|
3 |
Copyright (C) 2003, 2004, 2005, 2006, 2007, |
3 |
Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. |
4 |
2008 Free Software Foundation, Inc. |
|
|
5 |
|
4 |
|
6 |
This program is free software; you can redistribute it and/or modify it |
5 |
This program is free software; you can redistribute it and/or modify it |
7 |
under the terms of the GNU General Public License as published by the |
6 |
under the terms of the GNU General Public License as published by the |
Lines 52-58
sys_detect_dev_null_output (void)
Link Here
|
52 |
} |
51 |
} |
53 |
|
52 |
|
54 |
void |
53 |
void |
55 |
sys_wait_for_child (pid_t child_pid, bool eof) |
54 |
sys_drain_input_pipe (void) |
|
|
55 |
{ |
56 |
} |
57 |
|
58 |
void |
59 |
sys_wait_for_child (pid_t child_pid) |
56 |
{ |
60 |
{ |
57 |
} |
61 |
} |
58 |
|
62 |
|
Lines 156-163
sys_detect_dev_null_output (void)
Link Here
|
156 |
&& archive_stat.st_ino == dev_null_stat.st_ino)); |
160 |
&& archive_stat.st_ino == dev_null_stat.st_ino)); |
157 |
} |
161 |
} |
158 |
|
162 |
|
|
|
163 |
/* Manage to fully drain a pipe we might be reading, so to not break it on |
164 |
the producer after the EOF block. FIXME: one of these days, GNU tar |
165 |
might become clever enough to just stop working, once there is no more |
166 |
work to do, we might have to revise this area in such time. */ |
167 |
|
168 |
void |
169 |
sys_drain_input_pipe (void) |
170 |
{ |
171 |
size_t r; |
172 |
|
173 |
if (access_mode == ACCESS_READ |
174 |
&& ! _isrmt (archive) |
175 |
&& (S_ISFIFO (archive_stat.st_mode) || S_ISSOCK (archive_stat.st_mode))) |
176 |
while ((r = rmtread (archive, record_start->buffer, record_size)) != 0 |
177 |
&& r != SAFE_READ_ERROR) |
178 |
continue; |
179 |
} |
180 |
|
159 |
void |
181 |
void |
160 |
sys_wait_for_child (pid_t child_pid, bool eof) |
182 |
sys_wait_for_child (pid_t child_pid) |
161 |
{ |
183 |
{ |
162 |
if (child_pid) |
184 |
if (child_pid) |
163 |
{ |
185 |
{ |
Lines 171-181
sys_wait_for_child (pid_t child_pid, bool eof)
Link Here
|
171 |
} |
193 |
} |
172 |
|
194 |
|
173 |
if (WIFSIGNALED (wait_status)) |
195 |
if (WIFSIGNALED (wait_status)) |
174 |
{ |
196 |
ERROR ((0, 0, _("Child died with signal %d"), |
175 |
int sig = WTERMSIG (wait_status); |
197 |
WTERMSIG (wait_status))); |
176 |
if (!(!eof && sig == SIGPIPE)) |
|
|
177 |
ERROR ((0, 0, _("Child died with signal %d"), sig)); |
178 |
} |
179 |
else if (WEXITSTATUS (wait_status) != 0) |
198 |
else if (WEXITSTATUS (wait_status) != 0) |
180 |
ERROR ((0, 0, _("Child returned status %d"), |
199 |
ERROR ((0, 0, _("Child returned status %d"), |
181 |
WEXITSTATUS (wait_status))); |
200 |
WEXITSTATUS (wait_status))); |