summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes2014-07-29 13:42:53 -0500
committerAndroid Git Automerger2014-07-29 13:42:53 -0500
commit43eb2ea5f83c79032e6b9b566d0f4e3626683631 (patch)
tree0fe65e6eb2f79f7ea3e60acfdcaaba0385dfef14 /adb/services.c
parenta56ab4b00fe898a1d7768c1d3023fc998c7867b5 (diff)
parentec531e5cdde5e0b120bd88aeb2c3d36d18cedfb4 (diff)
downloadplatform-system-core-43eb2ea5f83c79032e6b9b566d0f4e3626683631.tar.gz
platform-system-core-43eb2ea5f83c79032e6b9b566d0f4e3626683631.tar.xz
platform-system-core-43eb2ea5f83c79032e6b9b566d0f4e3626683631.zip
am ec531e5c: am 47a12389: Merge "Fix adb "ptsname is not thread-safe; use ptsname_r instead" build break."
* commit 'ec531e5cdde5e0b120bd88aeb2c3d36d18cedfb4': Fix adb "ptsname is not thread-safe; use ptsname_r instead" build break.
Diffstat (limited to 'adb/services.c')
-rw-r--r--adb/services.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/adb/services.c b/adb/services.c
index 2875ce0a1..e61371ab1 100644
--- a/adb/services.c
+++ b/adb/services.c
@@ -206,7 +206,6 @@ static int create_subproc_pty(const char *cmd, const char *arg0, const char *arg
206 fprintf(stderr, "error: create_subproc_pty not implemented on Win32 (%s %s %s)\n", cmd, arg0, arg1); 206 fprintf(stderr, "error: create_subproc_pty not implemented on Win32 (%s %s %s)\n", cmd, arg0, arg1);
207 return -1; 207 return -1;
208#else /* !HAVE_WIN32_PROC */ 208#else /* !HAVE_WIN32_PROC */
209 char *devname;
210 int ptm; 209 int ptm;
211 210
212 ptm = unix_open("/dev/ptmx", O_RDWR | O_CLOEXEC); // | O_NOCTTY); 211 ptm = unix_open("/dev/ptmx", O_RDWR | O_CLOEXEC); // | O_NOCTTY);
@@ -215,8 +214,8 @@ static int create_subproc_pty(const char *cmd, const char *arg0, const char *arg
215 return -1; 214 return -1;
216 } 215 }
217 216
218 if(grantpt(ptm) || unlockpt(ptm) || 217 char devname[64];
219 ((devname = (char*) ptsname(ptm)) == 0)){ 218 if(grantpt(ptm) || unlockpt(ptm) || ptsname_r(ptm, devname, sizeof(devname)) != 0) {
220 printf("[ trouble with /dev/ptmx - %s ]\n", strerror(errno)); 219 printf("[ trouble with /dev/ptmx - %s ]\n", strerror(errno));
221 adb_close(ptm); 220 adb_close(ptm);
222 return -1; 221 return -1;