commit d556241a037d31a830ef830c6cb301419bb84087 from: Josh Rickmar date: Mon Jul 03 17:13:37 2023 UTC Define apply_umask earlier, without predeclaration ok op@ commit - 7b53188e4c59d5ce295c92624cacdeee16881abd commit + d556241a037d31a830ef830c6cb301419bb84087 blob - 158ecdaac43d28f8eb32bc6f3acf1cfda482fcaf blob + 39490809ede903773452d7a6331a5a959b7b756a --- lib/worktree.c +++ lib/worktree.c @@ -65,7 +65,15 @@ #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) @@ -1129,16 +1137,6 @@ get_ondisk_perms(int executable, mode_t st_mode) } return st_mode; -} - -static mode_t -apply_umask(mode_t mode) -{ - mode_t um; - - um = umask(000); - umask(um); - return mode & ~um; } /* forward declaration */