diff options
author | Steve Kondik <shade@chemlab.org> | 2012-11-18 15:47:18 -0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2012-11-18 15:47:18 -0800 |
commit | a546c7006355a7bd1df4267ee53d0bfa2c017c8c (patch) | |
tree | 01be0bf6c0d6968e1468ec9661fd52110f9b05a7 /android/qemu-setup.c | |
parent | baf3d7830396202df5cc47bd7bcee109c319cdb3 (diff) | |
parent | 0f809250987b64f491bd3b4b73c0f0d33036a786 (diff) | |
download | external_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.zip external_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.tar.gz external_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.tar.bz2 |
Merge branch 'jb-mr1-release' of https://android.googlesource.com/platform/external/qemu into mr1-staging
Change-Id: I8a4a71ac65b08e6e17f26c942f67a15b85211115
Diffstat (limited to 'android/qemu-setup.c')
-rw-r--r-- | android/qemu-setup.c | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/android/qemu-setup.c b/android/qemu-setup.c index 181c95b..8b8f0b0 100644 --- a/android/qemu-setup.c +++ b/android/qemu-setup.c @@ -47,6 +47,11 @@ char* op_http_proxy = NULL; /* Base port for the emulated system. */ int android_base_port; +/* Strings describing the host system's OpenGL implementation */ +char android_gl_vendor[ANDROID_GLSTRING_BUF_SIZE]; +char android_gl_renderer[ANDROID_GLSTRING_BUF_SIZE]; +char android_gl_version[ANDROID_GLSTRING_BUF_SIZE]; + /*** APPLICATION DIRECTORY *** Where are we ? ***/ @@ -483,6 +488,14 @@ void android_emulation_setup( void ) char tmp[PATH_MAX]; const char* appdir = get_app_dir(); + const size_t ARGSLEN = + PATH_MAX + // max ping program path + 10 + // max VERSION_STRING length + 3*ANDROID_GLSTRING_BUF_SIZE + // max GL string lengths + 29 + // static args characters + 1; // NUL terminator + char args[ARGSLEN]; + if (snprintf( tmp, PATH_MAX, "%s%s%s", appdir, PATH_SEP, _ANDROID_PING_PROGRAM ) >= PATH_MAX) { dprint( "Application directory too long: %s", appdir); @@ -507,10 +520,12 @@ void android_emulation_setup( void ) if (!comspec) comspec = "cmd.exe"; // Run - char args[PATH_MAX + 30]; - if (snprintf( args, PATH_MAX, "/C \"%s\" ping emulator " VERSION_STRING, - tmp) >= PATH_MAX ) { - D( "DDMS path too long: %s", tmp); + if (snprintf(args, ARGSLEN, + "/C \"%s\" ping emulator " VERSION_STRING " \"%s\" \"%s\" \"%s\"", + tmp, android_gl_vendor, android_gl_renderer, android_gl_version) + >= ARGSLEN) + { + D( "DDMS command line too long: %s", args); return; } @@ -540,13 +555,17 @@ void android_emulation_setup( void ) int fd = open("/dev/null", O_WRONLY); dup2(fd, 1); dup2(fd, 2); - execl( tmp, _ANDROID_PING_PROGRAM, "ping", "emulator", VERSION_STRING, NULL ); + execl( tmp, _ANDROID_PING_PROGRAM, "ping", "emulator", VERSION_STRING, + android_gl_vendor, android_gl_renderer, android_gl_version, + NULL ); } END_NOSIGALRM /* don't do anything in the parent or in case of error */ - strncat( tmp, " ping emulator " VERSION_STRING, PATH_MAX - strlen(tmp) ); - D( "ping command: %s", tmp ); + snprintf(args, ARGSLEN, + "%s ping emulator " VERSION_STRING " \"%s\" \"%s\" \"%s\"", + tmp, android_gl_vendor, android_gl_renderer, android_gl_version); + D( "ping command: %s", args ); #endif } } |