summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-10-06 11:02:04 +0200
committerDaniel Mack <github@zonque.org>2015-10-06 11:02:04 +0200
commit6c8fe330317c159fff33ed8cce8d55a195a9445e (patch)
treec2489c18003b6c9ac915d5d9a4c7b36765689ec8 /src/basic
parentc51abd80cf774815f57817da527639081d7002f4 (diff)
parent95c906ae0727123e45a9d88782133cac4554ddcd (diff)
Merge pull request #1452 from poettering/journal-vacuum
A variety of journal vacuuming improvements, plus an nspawn fix
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/util.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/basic/util.c b/src/basic/util.c
index c63ec0ceb0..9f520462cf 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -6168,16 +6168,19 @@ int openpt_in_namespace(pid_t pid, int flags) {
}
ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute, void *value, size_t size, int flags) {
+ char fn[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1];
_cleanup_close_ int fd = -1;
ssize_t l;
/* The kernel doesn't have a fgetxattrat() command, hence let's emulate one */
- fd = openat(dirfd, filename, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOATIME|(flags & AT_SYMLINK_NOFOLLOW ? O_NOFOLLOW : 0));
+ fd = openat(dirfd, filename, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_PATH|(flags & AT_SYMLINK_NOFOLLOW ? O_NOFOLLOW : 0));
if (fd < 0)
return -errno;
- l = fgetxattr(fd, attribute, value, size);
+ xsprintf(fn, "/proc/self/fd/%i", fd);
+
+ l = getxattr(fn, attribute, value, size);
if (l < 0)
return -errno;