summaryrefslogtreecommitdiffstats
path: root/recovery.c
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2009-09-01 17:27:43 +0200
committerJean-Baptiste Queru <jbq@google.com>2009-09-01 17:27:43 +0200
commitcbf903803850deb4f70490d97a1603e7b8679cc2 (patch)
tree8f7aee8dc461322d76a0071c60e8c9ad4227ee64 /recovery.c
parentdo not merge: cherry-pick of c2d666bd4f6eb5f7a9f17b10435c161cb105b7c5 from master (diff)
parentNot all failures to fopen_root_path() are serious. (diff)
downloadandroid_bootable_recovery-cbf903803850deb4f70490d97a1603e7b8679cc2.tar
android_bootable_recovery-cbf903803850deb4f70490d97a1603e7b8679cc2.tar.gz
android_bootable_recovery-cbf903803850deb4f70490d97a1603e7b8679cc2.tar.bz2
android_bootable_recovery-cbf903803850deb4f70490d97a1603e7b8679cc2.tar.lz
android_bootable_recovery-cbf903803850deb4f70490d97a1603e7b8679cc2.tar.xz
android_bootable_recovery-cbf903803850deb4f70490d97a1603e7b8679cc2.tar.zst
android_bootable_recovery-cbf903803850deb4f70490d97a1603e7b8679cc2.zip
Diffstat (limited to 'recovery.c')
-rw-r--r--recovery.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/recovery.c b/recovery.c
index f812e741b..33cbc13d8 100644
--- a/recovery.c
+++ b/recovery.c
@@ -130,7 +130,6 @@ fopen_root_path(const char *root_path, const char *mode) {
if (strchr("wa", mode[0])) dirCreateHierarchy(path, 0777, NULL, 1);
FILE *fp = fopen(path, mode);
- if (fp == NULL) LOGE("Can't open %s\n", path);
return fp;
}
@@ -228,7 +227,9 @@ finish_recovery(const char *send_intent)
// By this point, we're ready to return to the main system...
if (send_intent != NULL) {
FILE *fp = fopen_root_path(INTENT_FILE, "w");
- if (fp != NULL) {
+ if (fp == NULL) {
+ LOGE("Can't open %s\n", INTENT_FILE);
+ } else {
fputs(send_intent, fp);
check_and_fclose(fp, INTENT_FILE);
}
@@ -236,7 +237,9 @@ finish_recovery(const char *send_intent)
// Copy logs to cache so the system can find out what happened.
FILE *log = fopen_root_path(LOG_FILE, "a");
- if (log != NULL) {
+ if (log == NULL) {
+ LOGE("Can't open %s\n", LOG_FILE);
+ } else {
FILE *tmplog = fopen(TEMPORARY_LOG_FILE, "r");
if (tmplog == NULL) {
LOGE("Can't open %s\n", TEMPORARY_LOG_FILE);