umask-util: add helper that resets umask until end of current code block

This commit is contained in:
Lennart Poettering
2021-11-12 16:01:40 +01:00
parent b0c4b28246
commit 52f05ef21d
4 changed files with 9 additions and 9 deletions
+2 -1
View File
@@ -765,7 +765,6 @@ static void test_rename_noreplace(void) {
static void test_chmod_and_chown(void) {
_cleanup_(rm_rf_physical_and_freep) char *d = NULL;
_unused_ _cleanup_umask_ mode_t u = umask(0000);
struct stat st;
const char *p;
@@ -774,6 +773,8 @@ static void test_chmod_and_chown(void) {
log_info("/* %s */", __func__);
BLOCK_WITH_UMASK(0000);
assert_se(mkdtemp_malloc(NULL, &d) >= 0);
p = strjoina(d, "/reg");