canonicalizePathMetaData: Fall-back to utimes if lutimes fails due to ENOSYS

This commit is contained in:
Shea Levy 2012-11-05 23:00:21 -05:00 committed by Eelco Dolstra
parent 4c34d384e6
commit d0fc615af6

View file

@ -507,6 +507,8 @@ void canonicalisePathMetaData(const Path & path, bool recurse)
times[1].tv_usec = 0;
#if HAVE_LUTIMES
if (lutimes(path.c_str(), times) == -1)
if (errno != ENOSYS ||
(!S_ISLNK(st.st_mode) && utimes(path.c_str(), times) == -1))
#else
if (!S_ISLNK(st.st_mode) && utimes(path.c_str(), times) == -1)
#endif