From: Josh Rickmar Subject: Define apply_umask in a sane place To: gameoftrees@openbsd.org Date: Mon, 3 Jul 2023 12:43:18 -0400 No need for the forward declaration. diff /home/jrick/src/got commit - 7b53188e4c59d5ce295c92624cacdeee16881abd path + /home/jrick/src/got blob - 158ecdaac43d28f8eb32bc6f3acf1cfda482fcaf file + lib/worktree.c --- lib/worktree.c +++ lib/worktree.c @@ -65,8 +65,16 @@ static mode_t apply_umask(mode_t); #define GOT_MERGE_LABEL_MERGED "merged change" #define GOT_MERGE_LABEL_BASE "3-way merge base" -static mode_t apply_umask(mode_t); +static mode_t +apply_umask(mode_t mode) +{ + mode_t um; + um = umask(000); + umask(um); + return mode & ~um; +} + static const struct got_error * create_meta_file(const char *path_got, const char *name, const char *content) { @@ -1131,16 +1139,6 @@ static mode_t return st_mode; } -static mode_t -apply_umask(mode_t mode) -{ - mode_t um; - - um = umask(000); - umask(um); - return mode & ~um; -} - /* forward declaration */ static const struct got_error * install_blob(struct got_worktree *worktree, const char *ondisk_path,