_rc_deptree_load - return NULL if the stat() call is not successful

X-Gentoo-Bug: 643084
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=643084
This commit is contained in:
William Hubbs 2018-01-16 13:11:22 -06:00
parent fee2ffe559
commit 4af5a80b0c

View File

@ -380,7 +380,10 @@ RC_DEPTREE * _rc_deptree_load(int force, int *regen)
eend (retval, "Failed to update the dependency tree");
if (retval == 0) {
stat(RC_DEPTREE_CACHE, &st);
if (stat(RC_DEPTREE_CACHE, &st) != 0) {
eerror("stat(%s): %s", RC_DEPTREE_CACHE, strerror(errno));
return NULL;
}
if (st.st_mtime < t) {
eerror("Clock skew detected with `%s'", file);
eerrorn("Adjusting mtime of `" RC_DEPTREE_CACHE