Minor fix.

* src/extract.c (file_newer_p): Do not report error on ENOENT
This commit is contained in:
Sergey Poznyakoff
2009-06-23 16:52:33 +03:00
parent b7d206cb1e
commit 01c4475b17

View File

@@ -485,10 +485,14 @@ file_newer_p (const char *file_name, struct tar_stat_info *tar_stat)
struct stat st; struct stat st;
if (stat (file_name, &st)) if (stat (file_name, &st))
{
if (errno != ENOENT)
{ {
stat_warn (file_name); stat_warn (file_name);
/* Be on the safe side: if the file does exist assume it is newer */ /* Be on the safe side: if the file does exist assume it is newer */
return errno != ENOENT; return true;
}
return false;
} }
if (!S_ISDIR (st.st_mode) if (!S_ISDIR (st.st_mode)
&& tar_timespec_cmp (tar_stat->mtime, get_stat_mtime (&st)) <= 0) && tar_timespec_cmp (tar_stat->mtime, get_stat_mtime (&st)) <= 0)