OSDN Git Service

resolve merge conflicts of 9c65f4f50 to master
authorJosh Gao <jmgao@google.com>
Thu, 19 Jan 2017 00:14:03 +0000 (16:14 -0800)
committerJosh Gao <jmgao@google.com>
Thu, 19 Jan 2017 00:14:48 +0000 (16:14 -0800)
Change-Id: Icc63b82a4852222275c0bbafd84d4f535a0f8f10

1  2 
cmds/dumpstate/utils.cpp

@@@ -864,12 -1018,13 +864,12 @@@ const char *dump_traces() 
      }
  
      /* create a new, empty traces.txt file to receive stack dumps */
-     int fd = TEMP_FAILURE_RETRY(open(traces_path.c_str(),
-                                      O_CREAT | O_WRONLY | O_TRUNC | O_NOFOLLOW | O_CLOEXEC,
-                                      0666)); /* -rw-rw-rw- */
+     int fd = TEMP_FAILURE_RETRY(
 -        open(traces_path,
 -             O_CREAT | O_WRONLY | O_APPEND | O_TRUNC | O_NOFOLLOW | O_CLOEXEC,
++        open(traces_path.c_str(), O_CREAT | O_WRONLY | O_APPEND | O_TRUNC | O_NOFOLLOW | O_CLOEXEC,
+              0666)); /* -rw-rw-rw- */
      if (fd < 0) {
 -        MYLOGE("%s: %s\n", traces_path, strerror(errno));
 -        return NULL;
 +        MYLOGE("%s: %s\n", traces_path.c_str(), strerror(errno));
 +        return nullptr;
      }
      int chmod_ret = fchmod(fd, 0666);
      if (chmod_ret < 0) {