summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-07-29 18:07:32 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-07-28 22:45:44 +0000
commitf6304733878628b6a003a4ea3588b9fbb5943ce5 (patch)
treead54d6565bf15b3481371b6a4d8b2586581c15bf
parentbce3c0c7bd55e26a5ad4da5257a9621756e15f10 (diff)
parent84cfd1092d1087a9a4d9f13c2fa2440ecd73f5fc (diff)
downloadsystem_core-f6304733878628b6a003a4ea3588b9fbb5943ce5.zip
system_core-f6304733878628b6a003a4ea3588b9fbb5943ce5.tar.gz
system_core-f6304733878628b6a003a4ea3588b9fbb5943ce5.tar.bz2
Merge "Fix "ptsname is not thread-safe; use ptsname_r instead" build break."
-rw-r--r--logwrapper/logwrap.c4
1 files 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;