Commit 02c89327 by Jamie Madill Committed by Commit Bot

Capture/Replay: Fix capture build on Android.

A compile error slipped in due to lack of test coverage. Bug: angleproject:3611 Change-Id: Id34ce239f3913efb0ed1abab77321981419cab44 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1880160Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent adcda20c
...@@ -34,13 +34,14 @@ std::string GetDefaultOutDirectory() ...@@ -34,13 +34,14 @@ std::string GetDefaultOutDirectory()
// Linux interface to get application id of the running process // Linux interface to get application id of the running process
FILE *cmdline = fopen("/proc/self/cmdline", "r"); FILE *cmdline = fopen("/proc/self/cmdline", "r");
char applicationId[512];
if (cmdline) if (cmdline)
{ {
fread(sApplicationId, 1, sizeof(sApplicationId), cmdline); fread(applicationId, 1, sizeof(applicationId), cmdline);
fclose(cmdline); fclose(cmdline);
// Some package may have application id as <app_name>:<cmd_name> // Some package may have application id as <app_name>:<cmd_name>
char *colonSep = strchr(sApplicationId, ':'); char *colonSep = strchr(applicationId, ':');
if (colonSep) if (colonSep)
{ {
*colonSep = '\0'; *colonSep = '\0';
...@@ -50,7 +51,7 @@ std::string GetDefaultOutDirectory() ...@@ -50,7 +51,7 @@ std::string GetDefaultOutDirectory()
{ {
ERR() << "not able to lookup application id"; ERR() << "not able to lookup application id";
} }
path += std::string(sApplicationId) + "/"; path += std::string(applicationId) + "/";
return path; return path;
#else #else
return std::string("./"); return std::string("./");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment