[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/07: daemon: 'pathExists' uses 'statx' when available.
From: |
guix-commits |
Subject: |
03/07: daemon: 'pathExists' uses 'statx' when available. |
Date: |
Fri, 29 Nov 2019 09:54:28 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit b6b014bf42f68fcb71d37204328babb81e0e0855
Author: Ludovic Courtès <address@hidden>
Date: Fri Nov 29 13:54:36 2019 +0100
daemon: 'pathExists' uses 'statx' when available.
* nix/libutil/util.cc (pathExists) [HAVE_STATX]: New code.
---
nix/libutil/util.cc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/nix/libutil/util.cc b/nix/libutil/util.cc
index 8093b4c..faba378 100644
--- a/nix/libutil/util.cc
+++ b/nix/libutil/util.cc
@@ -177,8 +177,13 @@ struct stat lstat(const Path & path)
bool pathExists(const Path & path)
{
int res;
+#ifdef HAVE_STATX
+ struct statx st;
+ res = statx(AT_FDCWD, path.c_str(), AT_SYMLINK_NOFOLLOW, 0, &st);
+#else
struct stat st;
res = lstat(path.c_str(), &st);
+#endif
if (!res) return true;
if (errno != ENOENT && errno != ENOTDIR)
throw SysError(format("getting status of %1%") % path);
- branch master updated (809b396 -> dac7928), guix-commits, 2019/11/29
- 03/07: daemon: 'pathExists' uses 'statx' when available.,
guix-commits <=
- 01/07: gnu: xterm: Update to 351., guix-commits, 2019/11/29
- 02/07: gnu: openmpi: Increase priority of the PSM component., guix-commits, 2019/11/29
- 05/07: ui: Factorize 'with-profile-lock'., guix-commits, 2019/11/29
- 04/07: gnu: Add tdlib., guix-commits, 2019/11/29
- 06/07: ui: 'with-profile-lock' keeps going upon ENOLCK., guix-commits, 2019/11/29
- 07/07: tests: Fix race condition in profile locking test., guix-commits, 2019/11/29