]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util: drop two unused calls from src/basic/
authorLennart Poettering <lennart@poettering.net>
Sat, 13 Feb 2016 11:28:04 +0000 (12:28 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 13 Feb 2016 11:28:04 +0000 (12:28 +0100)
src/basic/fdset.c
src/basic/fdset.h
src/basic/fs-util.c
src/basic/fs-util.h

index 3674d3ed9da00f179d64f08f4602675b26392245..06f8ecbdbcf3c682c34bdb4f8b8296f10587c2d1 100644 (file)
@@ -94,19 +94,6 @@ int fdset_put(FDSet *s, int fd) {
         return set_put(MAKE_SET(s), FD_TO_PTR(fd));
 }
 
-int fdset_consume(FDSet *s, int fd) {
-        int r;
-
-        assert(s);
-        assert(fd >= 0);
-
-        r = fdset_put(s, fd);
-        if (r <= 0)
-                safe_close(fd);
-
-        return r;
-}
-
 int fdset_put_dup(FDSet *s, int fd) {
         int copy, r;
 
index 12d0cef7618d75322235bab9f04532895fb19b84..16efe5bdf206df17fe97d728a684aa20238a9601 100644 (file)
@@ -32,7 +32,6 @@ FDSet* fdset_free(FDSet *s);
 
 int fdset_put(FDSet *s, int fd);
 int fdset_put_dup(FDSet *s, int fd);
-int fdset_consume(FDSet *s, int fd);
 
 bool fdset_contains(FDSet *s, int fd);
 int fdset_remove(FDSet *s, int fd);
index 3ef1b90eddde9088976910ad10ae70b1adfa999b..51268828af4f07ea2ee4f0e6451d67d2c0877081 100644 (file)
@@ -283,24 +283,6 @@ int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid) {
         return 0;
 }
 
-int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid) {
-        assert(fd >= 0);
-
-        /* Under the assumption that we are running privileged we
-         * first change the access mode and only then hand out
-         * ownership to avoid a window where access is too open. */
-
-        if (mode != MODE_INVALID)
-                if (fchmod(fd, mode) < 0)
-                        return -errno;
-
-        if (uid != UID_INVALID || gid != GID_INVALID)
-                if (fchown(fd, uid, gid) < 0)
-                        return -errno;
-
-        return 0;
-}
-
 int fchmod_umask(int fd, mode_t m) {
         mode_t u;
         int r;
index 0e2fcb21b959a6214ee937e16d4c126a54bae507..0d23f8635fe6b14a729f83dc32d7558bb7245748 100644 (file)
@@ -43,7 +43,6 @@ int readlink_and_canonicalize(const char *p, char **r);
 int readlink_and_make_absolute_root(const char *root, const char *path, char **ret);
 
 int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid);
-int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid);
 
 int fchmod_umask(int fd, mode_t mode);