diff options
author | cjihrig <cjihrig@gmail.com> | 2019-04-08 17:09:53 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-04-10 20:41:39 -0400 |
commit | 547576f530afb0a5f0f98368212ee636a352d063 (patch) | |
tree | d99e5ab040fc93cbaafcfaab68ad2aa9c38f583f /src/node_internals.h | |
parent | 44a3acb6272accf6296be521ff2f626514874acc (diff) | |
download | node-new-547576f530afb0a5f0f98368212ee636a352d063.tar.gz |
src: always use diagnostic file sequence number
This commit attaches a sequence number to all filenames that
are automatically generated by DiagnosticFilename. This prevents
accidental overwriting of existing files.
PR-URL: https://github.com/nodejs/node/pull/27142
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'src/node_internals.h')
-rw-r--r-- | src/node_internals.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/node_internals.h b/src/node_internals.h index 7452dc05e9..bfc3a519f6 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -334,15 +334,13 @@ class DiagnosticFilename { DiagnosticFilename(Environment* env, const char* prefix, - const char* ext, - int seq = -1) : - filename_(MakeFilename(env->thread_id(), prefix, ext, seq)) {} + const char* ext) : + filename_(MakeFilename(env->thread_id(), prefix, ext)) {} DiagnosticFilename(uint64_t thread_id, const char* prefix, - const char* ext, - int seq = -1) : - filename_(MakeFilename(thread_id, prefix, ext, seq)) {} + const char* ext) : + filename_(MakeFilename(thread_id, prefix, ext)) {} const char* operator*() const { return filename_.c_str(); } @@ -350,8 +348,7 @@ class DiagnosticFilename { static std::string MakeFilename( uint64_t thread_id, const char* prefix, - const char* ext, - int seq = -1); + const char* ext); std::string filename_; }; |