diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-09-25T19·38-0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-09-25T19·38-0400 |
commit | e464b0247d9dd2c53770a851956dd34f82b7c9a6 (patch) | |
tree | 75517243f3ce6c5facd3e2424fefbaeeaaad1af1 /src/libutil/immutable.cc | |
parent | 28bf183d2d2f775e653efe4cee98d7359ce65455 (diff) | |
parent | b9c2b4d5b4cd5d52a950e6dd90eb2e2e79891fa0 (diff) |
Merge branch 'readonly-store'
Diffstat (limited to 'src/libutil/immutable.cc')
-rw-r--r-- | src/libutil/immutable.cc | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/libutil/immutable.cc b/src/libutil/immutable.cc index f72f85625486..766af4939331 100644 --- a/src/libutil/immutable.cc +++ b/src/libutil/immutable.cc @@ -16,7 +16,7 @@ namespace nix { -void changeMutable(const Path & path, bool mut) +void makeMutable(const Path & path) { #if defined(FS_IOC_SETFLAGS) && defined(FS_IOC_GETFLAGS) && defined(FS_IMMUTABLE_FL) @@ -38,30 +38,12 @@ void changeMutable(const Path & path, bool mut) /* Silently ignore errors getting/setting the immutable flag so that we work correctly on filesystems that don't support it. */ if (ioctl(fd, FS_IOC_GETFLAGS, &flags)) return; - old = flags; - - if (mut) flags &= ~FS_IMMUTABLE_FL; - else flags |= FS_IMMUTABLE_FL; - + flags &= ~FS_IMMUTABLE_FL; if (old == flags) return; - if (ioctl(fd, FS_IOC_SETFLAGS, &flags)) return; - #endif } -void makeImmutable(const Path & path) -{ - changeMutable(path, false); -} - - -void makeMutable(const Path & path) -{ - changeMutable(path, true); -} - - } |