From 509993e5983e333f5a50ee75d71c742590d304fb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 26 Feb 2014 18:48:32 +0100 Subject: [PATCH] Remove unused function --- src/libutil/util.cc | 28 ---------------------------- src/libutil/util.hh | 4 ---- 2 files changed, 32 deletions(-) diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 9437a2f99a..192ff528aa 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -281,34 +281,6 @@ void writeLine(int fd, string s) } -static void _computePathSize(const Path & path, - unsigned long long & bytes, unsigned long long & blocks) -{ - checkInterrupt(); - - struct stat st = lstat(path); - - bytes += st.st_size; - blocks += st.st_blocks; - - if (S_ISDIR(st.st_mode)) { - Strings names = readDirectory(path); - - for (Strings::iterator i = names.begin(); i != names.end(); ++i) - _computePathSize(path + "/" + *i, bytes, blocks); - } -} - - -void computePathSize(const Path & path, - unsigned long long & bytes, unsigned long long & blocks) -{ - bytes = 0; - blocks = 0; - _computePathSize(path, bytes, blocks); -} - - static void _deletePath(const Path & path, unsigned long long & bytesFreed) { checkInterrupt(); diff --git a/src/libutil/util.hh b/src/libutil/util.hh index 2335cbf988..c5c3fb2c35 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -78,10 +78,6 @@ string readLine(int fd); /* Write a line to a file descriptor. */ void writeLine(int fd, string s); -/* Compute the sum of the sizes of all files in `path'. */ -void computePathSize(const Path & path, - unsigned long long & bytes, unsigned long long & blocks); - /* Delete a path; i.e., in the case of a directory, it is deleted recursively. Don't use this at home, kids. The second variant returns the number of bytes and blocks freed. */