aboutsummaryrefslogtreecommitdiffstats
path: root/brillo/files/safe_fd.cc
diff options
context:
space:
mode:
Diffstat (limited to 'brillo/files/safe_fd.cc')
-rw-r--r--brillo/files/safe_fd.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/brillo/files/safe_fd.cc b/brillo/files/safe_fd.cc
index 1b4596f..3823387 100644
--- a/brillo/files/safe_fd.cc
+++ b/brillo/files/safe_fd.cc
@@ -48,6 +48,10 @@ SafeFD::SafeFDResult OpenPathComponentInternal(int parent_fd,
// symlink. It fails with ENXIO when |path| is a FIFO and |flags| is for
// writing because of the O_NONBLOCK flag added above.
switch (errno) {
+ case ENOENT:
+ // Do not write to the log because opening a non-existent file is a
+ // frequent occurrence.
+ return MakeErrorResult(SafeFD::Error::kDoesNotExist);
case ELOOP:
// PLOG prints something along the lines of the symlink depth being too
// great which is is misleading so LOG is used instead.