From 80cdb8d1d036f3a43350ed26f404fdbc7f40e969 Mon Sep 17 00:00:00 2001 From: Tri Vo Date: Thu, 17 May 2018 13:34:31 -0700 Subject: [PATCH] libpower: log errors to logcat Bug: n/a Test: failure to open /sys/power/wake_lock is now recorded in logcat Change-Id: Ifb390888d0e83b411295a35a3addbef604c930d0 --- power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/power.c b/power.c index 10ba380..fb60428 100644 --- a/power.c +++ b/power.c @@ -57,7 +57,7 @@ open_file_descriptors(const char * const paths[]) int fd = open(paths[i], O_RDWR | O_CLOEXEC); if (fd < 0) { g_error = -errno; - fprintf(stderr, "fatal error opening \"%s\": %s\n", paths[i], + ALOGE("fatal error opening \"%s\": %s\n", paths[i], strerror(errno)); return -1; }