summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2016-03-02 09:16:08 +0100
committerDaniel Mack <github@zonque.org>2016-03-02 09:16:08 +0100
commit77f911c56bcfe2eccf15d9fa77bdd306a0359879 (patch)
tree97f3e9b555ffc96d271c136a91dbfae279041513 /src/basic
parent2a0b102fd4ff6b629dbb85a2fbc2c3eae9328bb5 (diff)
parentc4b6915670ded7384795705ca9bb131da4763bac (diff)
Merge pull request #2779 from 0xAX/openat-opath-excess-flags
tree-wide: no need to pass excess flags to open()/openat() if O_PATH …
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/mount-util.c4
-rw-r--r--src/basic/xattr-util.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/basic/mount-util.c b/src/basic/mount-util.c
index 33f2ee96d8..5faa2eba05 100644
--- a/src/basic/mount-util.c
+++ b/src/basic/mount-util.c
@@ -47,7 +47,7 @@ static int fd_fdinfo_mnt_id(int fd, const char *filename, int flags, int *mnt_id
if ((flags & AT_EMPTY_PATH) && isempty(filename))
xsprintf(path, "/proc/self/fdinfo/%i", fd);
else {
- subfd = openat(fd, filename, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_PATH);
+ subfd = openat(fd, filename, O_CLOEXEC|O_PATH);
if (subfd < 0)
return -errno;
@@ -230,7 +230,7 @@ int path_is_mount_point(const char *t, int flags) {
if (!parent)
return -ENOMEM;
- fd = openat(AT_FDCWD, parent, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_PATH);
+ fd = openat(AT_FDCWD, parent, O_DIRECTORY|O_CLOEXEC|O_PATH);
if (fd < 0)
return -errno;
diff --git a/src/basic/xattr-util.c b/src/basic/xattr-util.c
index 8d7f14f382..8256899eda 100644
--- a/src/basic/xattr-util.c
+++ b/src/basic/xattr-util.c
@@ -110,7 +110,7 @@ ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute,
/* The kernel doesn't have a fgetxattrat() command, hence let's emulate one */
- fd = openat(dirfd, filename, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_PATH|(flags & AT_SYMLINK_NOFOLLOW ? O_NOFOLLOW : 0));
+ fd = openat(dirfd, filename, O_CLOEXEC|O_PATH|(flags & AT_SYMLINK_NOFOLLOW ? O_NOFOLLOW : 0));
if (fd < 0)
return -errno;