diff options
author | 2013-05-06 20:20:50 -0700 | |
---|---|---|
committer | 2013-05-07 18:28:11 -0700 | |
commit | 002e1e58dfe19dd3e49a59c6827cbf51573941a2 (patch) | |
tree | 6dc444d7f05aa0512e3c97344d86ee0264daf869 /libs/utils/misc.cpp | |
parent | b4f1a027cbadd4cd07341f60f859ae34643b68ae (diff) |
libutils clean-up
Change-Id: I6ff4cfc736751de2912c697f954e45e275f2d386
Diffstat (limited to 'libs/utils/misc.cpp')
-rw-r--r-- | libs/utils/misc.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/libs/utils/misc.cpp b/libs/utils/misc.cpp index 445a23a014..58eb49901a 100644 --- a/libs/utils/misc.cpp +++ b/libs/utils/misc.cpp @@ -25,7 +25,6 @@ #include <sys/stat.h> #include <string.h> #include <errno.h> -#include <assert.h> #include <stdio.h> #if defined(HAVE_PTHREADS) @@ -38,56 +37,6 @@ using namespace android; namespace android { -/* - * Get a file's type. - */ -FileType getFileType(const char* fileName) -{ - struct stat sb; - - if (stat(fileName, &sb) < 0) { - if (errno == ENOENT || errno == ENOTDIR) - return kFileTypeNonexistent; - else { - fprintf(stderr, "getFileType got errno=%d on '%s'\n", - errno, fileName); - return kFileTypeUnknown; - } - } else { - if (S_ISREG(sb.st_mode)) - return kFileTypeRegular; - else if (S_ISDIR(sb.st_mode)) - return kFileTypeDirectory; - else if (S_ISCHR(sb.st_mode)) - return kFileTypeCharDev; - else if (S_ISBLK(sb.st_mode)) - return kFileTypeBlockDev; - else if (S_ISFIFO(sb.st_mode)) - return kFileTypeFifo; -#ifdef HAVE_SYMLINKS - else if (S_ISLNK(sb.st_mode)) - return kFileTypeSymlink; - else if (S_ISSOCK(sb.st_mode)) - return kFileTypeSocket; -#endif - else - return kFileTypeUnknown; - } -} - -/* - * Get a file's modification date. - */ -time_t getFileModDate(const char* fileName) -{ - struct stat sb; - - if (stat(fileName, &sb) < 0) - return (time_t) -1; - - return sb.st_mtime; -} - struct sysprop_change_callback_info { sysprop_change_callback callback; int priority; |