From 432328cc550cea6b6ab23b3eeca69dc2307c5c74 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 26 Feb 2014 18:49:36 +0100 Subject: Remove another unused function --- src/libutil/util.cc | 19 ------------------- src/libutil/util.hh | 3 --- 2 files changed, 22 deletions(-) (limited to 'src') diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 192ff528aa6c..740d767a4ea6 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -326,25 +326,6 @@ void deletePath(const Path & path, unsigned long long & bytesFreed) } -void makePathReadOnly(const Path & path) -{ - checkInterrupt(); - - struct stat st = lstat(path); - - if (!S_ISLNK(st.st_mode) && (st.st_mode & S_IWUSR)) { - if (chmod(path.c_str(), st.st_mode & ~S_IWUSR) == -1) - throw SysError(format("making `%1%' read-only") % path); - } - - if (S_ISDIR(st.st_mode)) { - Strings names = readDirectory(path); - for (Strings::iterator i = names.begin(); i != names.end(); ++i) - makePathReadOnly(path + "/" + *i); - } -} - - static Path tempName(Path tmpRoot, const Path & prefix, bool includePid, int & counter) { diff --git a/src/libutil/util.hh b/src/libutil/util.hh index c5c3fb2c3568..0351220c2a24 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -85,9 +85,6 @@ void deletePath(const Path & path); void deletePath(const Path & path, unsigned long long & bytesFreed); -/* Make a path read-only recursively. */ -void makePathReadOnly(const Path & path); - /* Create a temporary directory. */ Path createTempDir(const Path & tmpRoot = "", const Path & prefix = "nix", bool includePid = true, bool useGlobalCounter = true, mode_t mode = 0755); -- cgit 1.4.1