X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fmisc.c;h=a087263556804d251b3a1e0a901b44448c8de18f;hb=84a55f12e5880196623d4193bf1d7f5141e6b0d5;hp=a76b24eb6764cc85106c8bc38fbfa94f446f76f0;hpb=2b1bffbad66faab91c3b080b63788d910f68632d;p=chaz%2Ftar diff --git a/src/misc.c b/src/misc.c index a76b24e..a087263 100644 --- a/src/misc.c +++ b/src/misc.c @@ -745,6 +745,36 @@ stat_diag (char const *name) stat_error (name); } +void +file_removed_diag (const char *name, bool top_level, + void (*diagfn) (char const *name)) +{ + if (!top_level && errno == ENOENT) + { + WARNOPT (WARN_FILE_REMOVED, + (0, 0, _("%s: File removed before we read it"), + quotearg_colon (name))); + set_exit_status (TAREXIT_DIFFERS); + } + else + diagfn (name); +} + +void +dir_removed_diag (const char *name, bool top_level, + void (*diagfn) (char const *name)) +{ + if (!top_level && errno == ENOENT) + { + WARNOPT (WARN_FILE_REMOVED, + (0, 0, _("%s: Directory removed before we read it"), + quotearg_colon (name))); + set_exit_status (TAREXIT_DIFFERS); + } + else + diagfn (name); +} + void write_fatal_details (char const *name, ssize_t status, size_t size) {