Skip to content

Commit

Permalink
add stale_file_handle error category
Browse files Browse the repository at this point in the history
Summary:
I want to test for this condition in a later diff.

(Note: this ignores all push blocking failures!)

Reviewed By: chadaustin, strager

Differential Revision: D9652042

fbshipit-source-id: 919fc592f940bb20693d98b6fa074a4f3cd50932
  • Loading branch information
wez authored and facebook-github-bot committed Sep 20, 2018
1 parent f0ad253 commit f29f123
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions error_category.cpp
Expand Up @@ -79,6 +79,11 @@ bool error_category::equivalent(const std::error_code& code, int condition)
case error_code::is_a_directory:
return code == make_error_code(std::errc::is_a_directory);

#ifdef ESTALE
case error_code::stale_file_handle:
return code == std::error_code(ESTALE, std::generic_category());
#endif

case error_code::too_many_symbolic_link_levels:
// POSIX says open with O_NOFOLLOW should set errno to ELOOP if the path
// is a symlink. However, FreeBSD (which ironically originated O_NOFOLLOW)
Expand Down
1 change: 1 addition & 0 deletions watchman_error_category.h
Expand Up @@ -24,6 +24,7 @@ enum class error_code {
timed_out,
not_a_symlink,
is_a_directory,
stale_file_handle,
};

// An error category implementation that is present for comparison purposes
Expand Down

0 comments on commit f29f123

Please sign in to comment.