From b0b856e2c69b594b7ba63dccaaaf0e12ac165b65 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 29 Jul 2014 11:05:18 -0700 Subject: Fix "ptsname is not thread-safe; use ptsname_r instead" build break. (cherry picked from commit 84cfd1092d1087a9a4d9f13c2fa2440ecd73f5fc) Change-Id: I5035348a4b17648996c7b8d53c990e3cebbe4baf --- logwrapper/logwrap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logwrapper/logwrap.c b/logwrapper/logwrap.c index d47c9b5..3a6276e 100644 --- a/logwrapper/logwrap.c +++ b/logwrapper/logwrap.c @@ -477,7 +477,6 @@ int android_fork_execvp_ext(int argc, char* argv[], int *status, bool ignore_int pid_t pid; int parent_ptty; int child_ptty; - char *child_devname = NULL; struct sigaction intact; struct sigaction quitact; sigset_t blockset; @@ -498,8 +497,9 @@ int android_fork_execvp_ext(int argc, char* argv[], int *status, bool ignore_int goto err_open; } + char child_devname[64]; if (grantpt(parent_ptty) || unlockpt(parent_ptty) || - ((child_devname = (char*)ptsname(parent_ptty)) == 0)) { + ptsname_r(parent_ptty, child_devname, sizeof(child_devname)) != 0) { ERROR("Problem with /dev/ptmx\n"); rc = -1; goto err_ptty; -- cgit v1.1