Remove another unused function
This commit is contained in:
parent
509993e598
commit
432328cc55
|
@ -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,
|
static Path tempName(Path tmpRoot, const Path & prefix, bool includePid,
|
||||||
int & counter)
|
int & counter)
|
||||||
{
|
{
|
||||||
|
|
|
@ -85,9 +85,6 @@ void deletePath(const Path & path);
|
||||||
|
|
||||||
void deletePath(const Path & path, unsigned long long & bytesFreed);
|
void deletePath(const Path & path, unsigned long long & bytesFreed);
|
||||||
|
|
||||||
/* Make a path read-only recursively. */
|
|
||||||
void makePathReadOnly(const Path & path);
|
|
||||||
|
|
||||||
/* Create a temporary directory. */
|
/* Create a temporary directory. */
|
||||||
Path createTempDir(const Path & tmpRoot = "", const Path & prefix = "nix",
|
Path createTempDir(const Path & tmpRoot = "", const Path & prefix = "nix",
|
||||||
bool includePid = true, bool useGlobalCounter = true, mode_t mode = 0755);
|
bool includePid = true, bool useGlobalCounter = true, mode_t mode = 0755);
|
||||||
|
|
Loading…
Reference in a new issue