Merge pull request #2234 from symphorien/esrch2

libstore/gc.cc: ignore ESRCH when reading symlinks in /proc
This commit is contained in:
Eelco Dolstra 2018-06-18 09:01:55 +02:00 committed by GitHub
commit 2e244fb68f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -366,7 +366,7 @@ try_again:
char buf[bufsiz]; char buf[bufsiz];
auto res = readlink(file.c_str(), buf, bufsiz); auto res = readlink(file.c_str(), buf, bufsiz);
if (res == -1) { if (res == -1) {
if (errno == ENOENT || errno == EACCES) if (errno == ENOENT || errno == EACCES || errno == ESRCH)
return; return;
throw SysError("reading symlink"); throw SysError("reading symlink");
} }