From 0c3a7c075e91ed2fb4a992cb62aadc1167d8a7db Mon Sep 17 00:00:00 2001 From: avz Date: Sat, 25 Jun 2011 02:42:20 -0700 Subject: [PATCH] Fix wrong error handling at Open() after open(2) in sync mode --- src/node_file.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_file.cc b/src/node_file.cc index ad0c7b4f9bd..660e3305cd5 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -664,8 +664,8 @@ static Handle Open(const Arguments& args) { ASYNC_CALL(open, args[3], *path, flags, mode) } else { int fd = open(*path, flags, mode); - SetCloseOnExec(fd); if (fd < 0) return ThrowException(ErrnoException(errno, NULL, "", *path)); + SetCloseOnExec(fd); return scope.Close(Integer::New(fd)); } }