Commit 16e57f2b authored by Zhangyi Chen's avatar Zhangyi Chen

Some tiny fixes:

- Fix the bug that when command line is too large
- Add weak symbol annotation to RunOnValgrind to avoid conflicts with absel
parent f7aab8c9
...@@ -59,8 +59,7 @@ ssize_t ReadCommandLine(char* buf, size_t len, bool with_args) { ...@@ -59,8 +59,7 @@ ssize_t ReadCommandLine(char* buf, size_t len, bool with_args) {
if (with_args) { if (with_args) {
if ((size_t)nr == len) { if ((size_t)nr == len) {
LOG(ERROR) << "buf is not big enough"; return len;
return -1;
} }
for (ssize_t i = 0; i < nr; ++i) { for (ssize_t i = 0; i < nr; ++i) {
if (buf[i] == '\0') { if (buf[i] == '\0') {
......
...@@ -255,7 +255,7 @@ static int GetRunningOnValgrind(void) { ...@@ -255,7 +255,7 @@ static int GetRunningOnValgrind(void) {
} }
/* See the comments in dynamic_annotations.h */ /* See the comments in dynamic_annotations.h */
int RunningOnValgrind(void) { int DYNAMIC_ANNOTATIONS_ATTRIBUTE_WEAK RunningOnValgrind(void) {
static volatile int running_on_valgrind = -1; static volatile int running_on_valgrind = -1;
/* C doesn't have thread-safe initialization of statics, and we /* C doesn't have thread-safe initialization of statics, and we
don't want to depend on pthread_once here, so hack it. */ don't want to depend on pthread_once here, so hack it. */
......
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