Commit 7fb073e7 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Don't spam console if memfd_create fails with ENOSYS

ENOSYS is an expected failure case for memfd_create() -- we provide a fallback
codepath for kernels that do not support it.

This CL only logs if memfd_create failed with an error other than ENOSYS.  This
should help to reduce the log spam introduced on the bots which mostly have
older kernels that do not support memfd_create().

R=thestig@chromium.org

Change-Id: Ib4d217187d1543c7e32dd9e900ef02661bfb817b
Reviewed-on: https://chromium-review.googlesource.com/802814
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520859}
parent 204d2387
...@@ -100,9 +100,10 @@ bool CreateMemFDSharedMemory(const SharedMemoryCreateOptions& options, ...@@ -100,9 +100,10 @@ bool CreateMemFDSharedMemory(const SharedMemoryCreateOptions& options,
return false; return false;
fd->reset(syscall(__NR_memfd_create, path->BaseName().value().c_str(), 0)); fd->reset(syscall(__NR_memfd_create, path->BaseName().value().c_str(), 0));
if (!fd->is_valid()) { if (!fd->is_valid()) {
DPLOG(ERROR) << "memfd(create) failed";
if (errno == ENOSYS) if (errno == ENOSYS)
try_memfd_create = false; try_memfd_create = false;
else
DPLOG(ERROR) << "memfd(create) failed";
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment