diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2013-07-18 23:18:50 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-07-20 12:09:29 +0200 |
commit | ca9eb718fbf2cd2c60c7aeb3ca33413e17fcbbf0 (patch) | |
tree | b9415d0e2f6005a651276cbc40d23196a8c02ddf /src/node_os.cc | |
parent | 0161ec87af3d71b10d8ce679c8a1a64358fae8dc (diff) | |
download | node-new-ca9eb718fbf2cd2c60c7aeb3ca33413e17fcbbf0.tar.gz |
src, lib: update after internal api change
Libuv now returns errors directly. Make everything in src/ and lib/
follow suit.
The changes to lib/ are not strictly necessary but they remove the need
for the abominations that are process._errno and node::SetErrno().
Diffstat (limited to 'src/node_os.cc')
-rw-r--r-- | src/node_os.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/node_os.cc b/src/node_os.cc index 6e11002be9..5b6e30b370 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -131,8 +131,8 @@ static void GetCPUInfo(const FunctionCallbackInfo<Value>& args) { uv_cpu_info_t* cpu_infos; int count, i; - uv_err_t err = uv_cpu_info(&cpu_infos, &count); - if (err.code != UV_OK) return; + int err = uv_cpu_info(&cpu_infos, &count); + if (err) return; Local<Array> cpus = Array::New(); for (i = 0; i < count; i++) { @@ -180,9 +180,8 @@ static void GetTotalMemory(const FunctionCallbackInfo<Value>& args) { static void GetUptime(const FunctionCallbackInfo<Value>& args) { HandleScope scope(node_isolate); double uptime; - uv_err_t err = uv_uptime(&uptime); - if (err.code != UV_OK) return; - args.GetReturnValue().Set(uptime); + int err = uv_uptime(&uptime); + if (err == 0) args.GetReturnValue().Set(uptime); } @@ -208,9 +207,9 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) { Local<String> name, family; Local<Array> ifarr; - uv_err_t err = uv_interface_addresses(&interfaces, &count); - if (err.code != UV_OK) { - return ThrowUVException(err.code, "uv_interface_addresses"); + int err = uv_interface_addresses(&interfaces, &count); + if (err) { + return ThrowUVException(err, "uv_interface_addresses"); } ret = Object::New(); |