am d69a1c50: Merge "Always use strerror to report errno."

* commit 'd69a1c502e11d3be052d9c0bb20f0c7762428925':
  Always use strerror to report errno.
This commit is contained in:
Elliott Hughes 2015-03-21 16:17:13 +00:00 committed by Android Git Automerger
commit b15ef843e5
4 changed files with 7 additions and 7 deletions

View file

@ -475,7 +475,7 @@ int do_mount_all(int nargs, char **args)
int wp_ret = TEMP_FAILURE_RETRY(waitpid(pid, &status, 0)); int wp_ret = TEMP_FAILURE_RETRY(waitpid(pid, &status, 0));
if (wp_ret < 0) { if (wp_ret < 0) {
/* Unexpected error code. We will continue anyway. */ /* 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)) { if (WIFEXITED(status)) {

View file

@ -871,7 +871,7 @@ try_loading_again:
booting = is_booting(); booting = is_booting();
goto try_loading_again; 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); write(loading_fd, "-1", 2);
goto data_close_out; goto data_close_out;
} }

View file

@ -80,7 +80,7 @@ void keychord_init()
ret = write(fd, keychords, keychords_length); ret = write(fd, keychords, keychords_length);
if (ret != 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); close(fd);
fd = -1; fd = -1;
} }

View file

@ -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); snprintf(tempPath, sizeof(tempPath), "%s/.temp.XXXXXX", PERSISTENT_PROPERTY_DIR);
fd = mkstemp(tempPath); fd = mkstemp(tempPath);
if (fd < 0) { 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; return;
} }
write(fd, value, strlen(value)); write(fd, value, strlen(value));
@ -289,15 +289,15 @@ void handle_property_set_fd()
close(s); close(s);
return; return;
} else if (nr < 0) { } 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); close(s);
return; return;
} }
r = TEMP_FAILURE_RETRY(recv(s, &msg, sizeof(msg), MSG_DONTWAIT)); r = TEMP_FAILURE_RETRY(recv(s, &msg, sizeof(msg), MSG_DONTWAIT));
if(r != sizeof(prop_msg)) { if(r != sizeof(prop_msg)) {
ERROR("sys_prop: mis-match msg size received: %d expected: %zu errno: %d\n", ERROR("sys_prop: mis-match msg size received: %d expected: %zu: %s\n",
r, sizeof(prop_msg), errno); r, sizeof(prop_msg), strerror(errno));
close(s); close(s);
return; return;
} }