Skip to content

Commit

Permalink
Handle ENOENT when getting canonical case of a path
Browse files Browse the repository at this point in the history
If we try to get the canonical name for a file that has been deleted
since the last observation, just return the input path.

This was found by running the hgwatchman test suite.
  • Loading branch information
wez committed Jul 9, 2014
1 parent 4016c5c commit 8ff5d80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions root.c
Expand Up @@ -929,6 +929,10 @@ static w_string_t *w_resolve_filesystem_canonical_name(const char *path)

if (getattrlist(path, &attrlist, &vomit,
sizeof(vomit), FSOPT_NOFOLLOW) == -1) {
if (errno == ENOENT) {
return w_string_new(path);
}

w_log(W_LOG_FATAL, "getattrlist(CMN_NAME: %s): fail %s\n",
path, strerror(errno));
}
Expand Down

0 comments on commit 8ff5d80

Please sign in to comment.