From 81321af5ab3878b79f43d46fb6a8f6963a626708 Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Thu, 24 Mar 2016 17:03:18 +0900 Subject: [PATCH] common: remove thread unsafe function Change-Id: Icdf26e6f8921dec7b884de8a25277d0d4e42b1fc Signed-off-by: Taeyoung Kim --- src/crash-pipe/crash-pipe.c | 4 ++-- src/shared/util.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/crash-pipe/crash-pipe.c b/src/crash-pipe/crash-pipe.c index d6ad0b5..a0b899a 100644 --- a/src/crash-pipe/crash-pipe.c +++ b/src/crash-pipe/crash-pipe.c @@ -192,8 +192,8 @@ static int save_core(const char *core_path) for (n = 0, remaining = readb ; remaining > 0; remaining -= n) { n = write(fd, buf, remaining); if (n == -1) { - syslog(LOG_ERR, "crash-pipe: Error while saving core file %s: %s. Removing core.\n", - core_path, strerror(errno)); + syslog(LOG_ERR, "crash-pipe: Error while saving core file %s: %d. Removing core.\n", + core_path, errno); (void)unlink(core_path); // XXX check errors here too goto out; } diff --git a/src/shared/util.c b/src/shared/util.c index eed0476..776ab92 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -84,7 +84,7 @@ int system_command_with_timeout(int timeout_seconds, char *command) pid_t pid = fork(); /* handle error case */ if (pid < 0) { - _E("fork: %s\n", strerror(errno)); + _E("fork: %d\n", errno); return pid; } /* handle child case */ @@ -309,7 +309,7 @@ static int remove_dir_internal(int fd) continue; subfd = openat(fd, de->d_name, O_RDONLY | O_DIRECTORY); if (subfd < 0) { - _SE("Couldn't openat %s: %s\n", de->d_name, strerror(errno)); + _SE("Couldn't openat %s: %d\n", de->d_name, errno); ret = -1; continue; } -- 2.7.4