Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
os: change CPU time from Integer to Number
Browse files Browse the repository at this point in the history
CPU time values must be Numbers, not Integers, as they can be too large
for Integers on 32 bit platforms.
  • Loading branch information
tfeb authored and bnoordhuis committed Dec 31, 2012
1 parent acc085e commit 50e88d0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/node_os.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ static Handle<Value> GetCPUInfo(const Arguments& args) {
for (i = 0; i < count; i++) {
Local<Object> times_info = Object::New();
times_info->Set(String::New("user"),
Integer::New(cpu_infos[i].cpu_times.user));
Number::New(cpu_infos[i].cpu_times.user));
times_info->Set(String::New("nice"),
Integer::New(cpu_infos[i].cpu_times.nice));
Number::New(cpu_infos[i].cpu_times.nice));
times_info->Set(String::New("sys"),
Integer::New(cpu_infos[i].cpu_times.sys));
Number::New(cpu_infos[i].cpu_times.sys));
times_info->Set(String::New("idle"),
Integer::New(cpu_infos[i].cpu_times.idle));
Number::New(cpu_infos[i].cpu_times.idle));
times_info->Set(String::New("irq"),
Integer::New(cpu_infos[i].cpu_times.irq));
Number::New(cpu_infos[i].cpu_times.irq));

Local<Object> cpu_info = Object::New();
cpu_info->Set(String::New("model"), String::New(cpu_infos[i].model));
Expand Down

0 comments on commit 50e88d0

Please sign in to comment.