GeezerVison is showing github.com — src: remove fixed-size GetHumanReadableProcessName · jaku/node@3271c40
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/node_errors.cc +2-3Lines changed: 2 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -242,12 +242,11 @@ void AppendExceptionLine(Environment* env, |
242 | 242 | } |
243 | 243 |
|
244 | 244 | [[noreturn]] void Assert(const AssertionInfo& info) { |
245 | | - char name[1024]; |
246 | | - GetHumanReadableProcessName(&name); |
| 245 | + std::string name = GetHumanReadableProcessName(); |
247 | 246 |
|
248 | 247 | fprintf(stderr, |
249 | 248 | "%s: %s:%s%s Assertion `%s' failed.\n", |
250 | | - name, |
| 249 | + name.c_str(), |
251 | 250 | info.file_line, |
252 | 251 | info.function, |
253 | 252 | *info.function ? ":" : "", |
|
Collapse file
Copy file name to clipboardExpand all lines: src/node_internals.h -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -97,7 +97,6 @@ void SignalExit(int signal, siginfo_t* info, void* ucontext); |
97 | 97 |
|
98 | 98 | std::string GetProcessTitle(const char* default_title); |
99 | 99 | std::string GetHumanReadableProcessName(); |
100 | | -void GetHumanReadableProcessName(char (*name)[1024]); |
101 | 100 |
|
102 | 101 | void InitializeContextRuntime(v8::Local<v8::Context>); |
103 | 102 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: src/util.cc -7Lines changed: 0 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -161,13 +161,6 @@ std::string GetHumanReadableProcessName() { |
161 | 161 | return SPrintF("%s[%d]", GetProcessTitle("Node.js"), uv_os_getpid()); |
162 | 162 | } |
163 | 163 |
|
164 | | -void GetHumanReadableProcessName(char (*name)[1024]) { |
165 | | - // Leave room after title for pid, which can be up to 20 digits for 64 bit. |
166 | | - char title[1000] = "Node.js"; |
167 | | - uv_get_process_title(title, sizeof(title)); |
168 | | - snprintf(*name, sizeof(*name), "%s[%d]", title, uv_os_getpid()); |
169 | | -} |
170 | | - |
171 | 164 | std::vector<std::string> SplitString(const std::string& in, char delim) { |
172 | 165 | std::vector<std::string> out; |
173 | 166 | if (in.empty()) |
|