diff options
author | Elliott Hughes <enh@google.com> | 2015-03-20 17:05:56 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2015-03-20 17:05:56 -0700 |
commit | cd67f00e18de1c8d48ddb082ecb902fc42c2bacc (patch) | |
tree | cd431ef29d8fbbe895b1a7ade750dcb9123c507f /init | |
parent | bf684148e2f8182079b9483e7ead30d9b93cd020 (diff) | |
download | core-cd67f00e18de1c8d48ddb082ecb902fc42c2bacc.tar.gz core-cd67f00e18de1c8d48ddb082ecb902fc42c2bacc.tar.bz2 core-cd67f00e18de1c8d48ddb082ecb902fc42c2bacc.zip |
Always use strerror to report errno.
Change-Id: Icd18e4bd7dc093c18967f45b99cd451359457b03
Diffstat (limited to 'init')
-rw-r--r-- | init/builtins.cpp | 2 | ||||
-rw-r--r-- | init/devices.cpp | 2 | ||||
-rw-r--r-- | init/keychords.cpp | 2 | ||||
-rw-r--r-- | init/property_service.cpp | 8 |
4 files changed, 7 insertions, 7 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index e659cfae9..6daea3702 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -475,7 +475,7 @@ int do_mount_all(int nargs, char **args) int wp_ret = TEMP_FAILURE_RETRY(waitpid(pid, &status, 0)); if (wp_ret < 0) { /* Unexpected error code. We will continue anyway. */ - NOTICE("waitpid failed rc=%d, errno=%d\n", wp_ret, errno); + NOTICE("waitpid failed rc=%d: %s\n", wp_ret, strerror(errno)); } if (WIFEXITED(status)) { diff --git a/init/devices.cpp b/init/devices.cpp index aa86e5fed..9bce39abc 100644 --- a/init/devices.cpp +++ b/init/devices.cpp @@ -871,7 +871,7 @@ try_loading_again: booting = is_booting(); goto try_loading_again; } - INFO("firmware: could not open '%s' %d\n", uevent->firmware, errno); + INFO("firmware: could not open '%s': %s\n", uevent->firmware, strerror(errno)); write(loading_fd, "-1", 2); goto data_close_out; } diff --git a/init/keychords.cpp b/init/keychords.cpp index d6464bddc..2e996ea6a 100644 --- a/init/keychords.cpp +++ b/init/keychords.cpp @@ -80,7 +80,7 @@ void keychord_init() ret = write(fd, keychords, keychords_length); if (ret != keychords_length) { - ERROR("could not configure /dev/keychord %d (%d)\n", ret, errno); + ERROR("could not configure /dev/keychord %d: %s\n", ret, strerror(errno)); close(fd); fd = -1; } diff --git a/init/property_service.cpp b/init/property_service.cpp index 2031aaea6..0e03a1d53 100644 --- a/init/property_service.cpp +++ b/init/property_service.cpp @@ -161,7 +161,7 @@ static void write_persistent_property(const char *name, const char *value) snprintf(tempPath, sizeof(tempPath), "%s/.temp.XXXXXX", PERSISTENT_PROPERTY_DIR); fd = mkstemp(tempPath); if (fd < 0) { - ERROR("Unable to write persistent property to temp file %s errno: %d\n", tempPath, errno); + ERROR("Unable to write persistent property to temp file %s: %s\n", tempPath, strerror(errno)); return; } write(fd, value, strlen(value)); @@ -289,15 +289,15 @@ void handle_property_set_fd() close(s); return; } else if (nr < 0) { - ERROR("sys_prop: error waiting for uid=%d to send property message. err=%d %s\n", cr.uid, errno, strerror(errno)); + ERROR("sys_prop: error waiting for uid=%d to send property message: %s\n", cr.uid, strerror(errno)); close(s); return; } r = TEMP_FAILURE_RETRY(recv(s, &msg, sizeof(msg), MSG_DONTWAIT)); if(r != sizeof(prop_msg)) { - ERROR("sys_prop: mis-match msg size received: %d expected: %zu errno: %d\n", - r, sizeof(prop_msg), errno); + ERROR("sys_prop: mis-match msg size received: %d expected: %zu: %s\n", + r, sizeof(prop_msg), strerror(errno)); close(s); return; } |