summaryrefslogtreecommitdiff
path: root/src/node_file.cc
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-02-07 14:51:10 -0500
committerRuben Bridgewater <ruben@bridgewater.de>2018-02-10 14:48:16 +0100
commit28708677d941f51ebdcee2640b8b95f36110ad39 (patch)
treeda7264ece5664e9942647ae300146e14160463d8 /src/node_file.cc
parent1729af2ce907bd1c97b501fb2dce3d94ccc2174c (diff)
downloadandroid-node-v8-28708677d941f51ebdcee2640b8b95f36110ad39.tar.gz
android-node-v8-28708677d941f51ebdcee2640b8b95f36110ad39.tar.bz2
android-node-v8-28708677d941f51ebdcee2640b8b95f36110ad39.zip
src: resolve issues reported by coverity
The specific issues raised by Coverity are: ** CID 182716: Control flow issues (DEADCODE) /src/node_file.cc: 1192 >>> CID 182716: Control flow issues (DEADCODE) >>> Execution cannot reach this statement: "args->GetReturnValue().Set(...". ** CID 182715: Uninitialized members (UNINIT_CTOR) /src/node_file.h: 29 >>> CID 182715: Uninitialized members (UNINIT_CTOR) >>> Non-static class member "syscall_" is not initialized in this constructor nor in any functions that it calls. PR-URL: https://github.com/nodejs/node/pull/18629 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_file.cc')
-rw-r--r--src/node_file.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/node_file.cc b/src/node_file.cc
index 62dd5fe80c..7991cdd350 100644
--- a/src/node_file.cc
+++ b/src/node_file.cc
@@ -1192,13 +1192,9 @@ static void OpenFileHandle(const FunctionCallbackInfo<Value>& args) {
req_wrap->SetReturnValue(args);
} else {
SYNC_CALL(open, *path, *path, flags, mode)
- if (SYNC_RESULT < 0) {
- args.GetReturnValue().Set(SYNC_RESULT);
- } else {
- HandleScope scope(env->isolate());
- FileHandle* fd = new FileHandle(env, SYNC_RESULT);
- args.GetReturnValue().Set(fd->object());
- }
+ HandleScope scope(env->isolate());
+ FileHandle* fd = new FileHandle(env, SYNC_RESULT);
+ args.GetReturnValue().Set(fd->object());
}
}