Bug 1258269: Declare logging string-literals in exception_handler.cc as 'const char[]' to fix build warning & for consistency. r?ted
MozReview-Commit-ID: 9UDHiPJus0C
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
@@ -527,27 +527,29 @@ bool ExceptionHandler::GenerateDump(Cras
&thread_arg, NULL, NULL, NULL);
if (child == -1) {
sys_close(fdes[0]);
sys_close(fdes[1]);
return false;
}
if (child != 0) {
- char *clonedMsg = "ExceptionHandler::GenerateDump cloned child ";
+ static const char clonedMsg[] =
+ "ExceptionHandler::GenerateDump cloned child ";
char pidMsg[32];
unsigned int pidLen = my_uint_len(child);
my_uitos(pidMsg, child, pidLen);
logger::write(clonedMsg, my_strlen(clonedMsg));
logger::write(pidMsg, pidLen);
logger::write("\n", 1);
} else {
- char *childMsg = "ExceptionHandler::GenerateDump I'm the child\n";
+ static const char childMsg[] =
+ "ExceptionHandler::GenerateDump I'm the child\n";
logger::write(childMsg, my_strlen(childMsg));
}
// Allow the child to ptrace us
sys_prctl(PR_SET_PTRACER, child, 0, 0, 0);
SendContinueSignalToChild();
int status;
const int r = HANDLE_EINTR(sys_waitpid(child, &status, __WALL));