diff options
author | Kenny Root <kroot@google.com> | 2010-08-05 11:45:54 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-08-05 11:45:54 -0700 |
commit | 0645f9699c2bf6b636e87711b7beebdc0eb955e6 (patch) | |
tree | afac62941a0e7eaf50bf54d1105224ab315e5f4b /cmds/installd/utils.c | |
parent | 56b6fcaa7a264edfb351eeb3b10bfb2aa7acd39b (diff) | |
parent | 1cd6340a72d81c81630d6374ed46211497520897 (diff) | |
download | frameworks_base-0645f9699c2bf6b636e87711b7beebdc0eb955e6.zip frameworks_base-0645f9699c2bf6b636e87711b7beebdc0eb955e6.tar.gz frameworks_base-0645f9699c2bf6b636e87711b7beebdc0eb955e6.tar.bz2 |
am 1cd6340a: am 50871525: Add more debugging to installd
Merge commit '1cd6340a72d81c81630d6374ed46211497520897'
* commit '1cd6340a72d81c81630d6374ed46211497520897':
Add more debugging to installd
Diffstat (limited to 'cmds/installd/utils.c')
-rw-r--r-- | cmds/installd/utils.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cmds/installd/utils.c b/cmds/installd/utils.c index 555c19e..a5e4b5a 100644 --- a/cmds/installd/utils.c +++ b/cmds/installd/utils.c @@ -98,11 +98,13 @@ static int _delete_dir_contents(DIR *d, const char *ignore) subfd = openat(dfd, name, O_RDONLY | O_DIRECTORY); if (subfd < 0) { + LOGE("Couldn't openat %s: %s\n", name, strerror(errno)); result = -1; continue; } subdir = fdopendir(subfd); if (subdir == NULL) { + LOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno)); close(subfd); result = -1; continue; @@ -112,10 +114,12 @@ static int _delete_dir_contents(DIR *d, const char *ignore) } closedir(subdir); if (unlinkat(dfd, name, AT_REMOVEDIR) < 0) { + LOGE("Couldn't unlinkat %s: %s\n", name, strerror(errno)); result = -1; } } else { if (unlinkat(dfd, name, 0) < 0) { + LOGE("Couldn't unlinkat %s: %s\n", name, strerror(errno)); result = -1; } } @@ -133,12 +137,14 @@ int delete_dir_contents(const char *pathname, d = opendir(pathname); if (d == NULL) { + LOGE("Couldn't opendir %s: %s\n", pathname, strerror(errno)); return -errno; } res = _delete_dir_contents(d, ignore); closedir(d); if (also_delete_dir) { if (rmdir(pathname)) { + LOGE("Couldn't rmdir %s: %s\n", pathname, strerror(errno)); res = -1; } } @@ -152,10 +158,12 @@ int delete_dir_contents_fd(int dfd, const char *name) fd = openat(dfd, name, O_RDONLY | O_DIRECTORY); if (fd < 0) { + LOGE("Couldn't openat %s: %s\n", name, strerror(errno)); return -1; } d = fdopendir(fd); if (d == NULL) { + LOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno)); close(fd); return -1; } |