summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-09-05 11:20:12 -0700
committerRussell Belfer <rb@github.com>2013-09-05 11:20:12 -0700
commitf240acce865ec14df0d517d5000316a933e7ffed (patch)
tree33bb2efbb07ac32178ce242899ecaa8c6842c308 /src/fileops.c
parent27061b151a7e0225186365ee0b5ca802d68782a9 (diff)
downloadlibgit2-f240acce865ec14df0d517d5000316a933e7ffed.tar.gz
Add more file mode permissions macros
This adds some more macros for some standard operations on file modes, particularly related to permissions, and then updates a number of places around the code base to use the new macros.
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fileops.c b/src/fileops.c
index 76119e02e..92cda82e7 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -110,7 +110,7 @@ git_off_t git_futils_filesize(git_file fd)
mode_t git_futils_canonical_mode(mode_t raw_mode)
{
if (S_ISREG(raw_mode))
- return S_IFREG | GIT_CANONICAL_PERMS(raw_mode);
+ return S_IFREG | GIT_PERMS_CANONICAL(raw_mode);
else if (S_ISLNK(raw_mode))
return S_IFLNK;
else if (S_ISGITLINK(raw_mode))
@@ -972,7 +972,7 @@ static int _cp_r_callback(void *ref, git_buf *from)
mode_t usemode = from_st.st_mode;
if ((info->flags & GIT_CPDIR_SIMPLE_TO_MODE) != 0)
- usemode = (usemode & 0111) ? 0777 : 0666;
+ usemode = GIT_PERMS_FOR_WRITE(usemode);
error = git_futils_cp(from->ptr, info->to.ptr, usemode);
}