From: Zbigniew Jędrzejewski-Szmek Date: Mon, 21 Aug 2023 18:44:05 +0000 (+0200) Subject: basic/umask-util: drop clearing of unused bits in call to umask(2) X-Git-Tag: v255-rc1~646^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8980a53f24b5b5d43be947f4f959924d6b91fbd1;p=thirdparty%2Fsystemd.git basic/umask-util: drop clearing of unused bits in call to umask(2) umask(2) says that the kernel does this exact operation on its own, so we can drop if from our call. --- diff --git a/src/basic/umask-util.h b/src/basic/umask-util.h index 6f0e1cc2b24..00417fa3045 100644 --- a/src/basic/umask-util.h +++ b/src/basic/umask-util.h @@ -8,12 +8,12 @@ #include "macro.h" static inline void umaskp(mode_t *u) { - umask(*u & 0777); + umask(*u); } #define _cleanup_umask_ _cleanup_(umaskp) -/* We make use of the fact here that the umask() concept is using only the lower 9 bits of mode_t, although +/* We make use of the fact here that the umask() syscall uses only the lower 9 bits of mode_t, although * mode_t has space for the file type in the bits further up. We simply OR in the file type mask S_IFMT to * distinguish the first and the second iteration of the WITH_UMASK() loop, so that we can run the first one, * and exit on the second. */