diff options
author | Elliott Hughes <enh@google.com> | 2014-07-29 11:05:18 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-07-29 11:06:53 -0700 |
commit | 84cfd1092d1087a9a4d9f13c2fa2440ecd73f5fc (patch) | |
tree | ad54d6565bf15b3481371b6a4d8b2586581c15bf /logwrapper | |
parent | bce3c0c7bd55e26a5ad4da5257a9621756e15f10 (diff) | |
download | system_core-84cfd1092d1087a9a4d9f13c2fa2440ecd73f5fc.zip system_core-84cfd1092d1087a9a4d9f13c2fa2440ecd73f5fc.tar.gz system_core-84cfd1092d1087a9a4d9f13c2fa2440ecd73f5fc.tar.bz2 |
Fix "ptsname is not thread-safe; use ptsname_r instead" build break.
Change-Id: I8fdca8e85056e99e943bdcf93a48574d76addcdc
Diffstat (limited to 'logwrapper')
-rw-r--r-- | logwrapper/logwrap.c | 4 |
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; |