X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fmisc.c;h=b11b20eb67142a084f4783af28c3d1601e22768b;hb=51aee274e892923a3f8fdb774e4f6b90bce47437;hp=a76b24eb6764cc85106c8bc38fbfa94f446f76f0;hpb=2b1bffbad66faab91c3b080b63788d910f68632d;p=chaz%2Ftar diff --git a/src/misc.c b/src/misc.c index a76b24e..b11b20e 100644 --- a/src/misc.c +++ b/src/misc.c @@ -745,6 +745,30 @@ 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))); + 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))); + else + diagfn (name); +} + void write_fatal_details (char const *name, ssize_t status, size_t size) {