am 47a12389: Merge "Fix adb "ptsname is not thread-safe; use ptsname_r instead" build break."
* commit '47a123895b11702e25ea217860ad173434ebfa6c': Fix adb "ptsname is not thread-safe; use ptsname_r instead" build break.
This commit is contained in:
commit
ec531e5cdd
1 changed files with 2 additions and 3 deletions
|
|
@ -206,7 +206,6 @@ static int create_subproc_pty(const char *cmd, const char *arg0, const char *arg
|
||||||
fprintf(stderr, "error: create_subproc_pty not implemented on Win32 (%s %s %s)\n", cmd, arg0, arg1);
|
fprintf(stderr, "error: create_subproc_pty not implemented on Win32 (%s %s %s)\n", cmd, arg0, arg1);
|
||||||
return -1;
|
return -1;
|
||||||
#else /* !HAVE_WIN32_PROC */
|
#else /* !HAVE_WIN32_PROC */
|
||||||
char *devname;
|
|
||||||
int ptm;
|
int ptm;
|
||||||
|
|
||||||
ptm = unix_open("/dev/ptmx", O_RDWR | O_CLOEXEC); // | O_NOCTTY);
|
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
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(grantpt(ptm) || unlockpt(ptm) ||
|
char devname[64];
|
||||||
((devname = (char*) ptsname(ptm)) == 0)){
|
if(grantpt(ptm) || unlockpt(ptm) || ptsname_r(ptm, devname, sizeof(devname)) != 0) {
|
||||||
printf("[ trouble with /dev/ptmx - %s ]\n", strerror(errno));
|
printf("[ trouble with /dev/ptmx - %s ]\n", strerror(errno));
|
||||||
adb_close(ptm);
|
adb_close(ptm);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue