From be7656625120c781234727d93b3f8cabcc4012a3 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Wed, 29 Jul 2015 15:44:36 -0700 Subject: Quiet JNI compilation warning about ptsname --- app/src/main/jni/com_google_ase_Exec.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/src/main/jni/com_google_ase_Exec.cpp b/app/src/main/jni/com_google_ase_Exec.cpp index b78f356..b2fa39f 100644 --- a/app/src/main/jni/com_google_ase_Exec.cpp +++ b/app/src/main/jni/com_google_ase_Exec.cpp @@ -79,7 +79,7 @@ int jniGetFDFromFileDescriptor(JNIEnv* env, jobject fileDescriptor) { static int create_subprocess( const char* cmd, const char* arg0, const char* arg1, int* pProcessId) { - char* devname; + char devname[32]; int ptm; pid_t pid; @@ -91,7 +91,7 @@ static int create_subprocess( fcntl(ptm, F_SETFD, FD_CLOEXEC); if(grantpt(ptm) || unlockpt(ptm) || - ((devname = (char*) ptsname(ptm)) == 0)){ + ptsname_r(ptm, devname, sizeof(devname))){ LOG("[ trouble with /dev/ptmx - %s ]\n", strerror(errno)); return -1; } -- cgit v1.2.3