Skip to content

Commit 50e88d0

Browse files
tfebbnoordhuis
authored andcommitted
os: change CPU time from Integer to Number
CPU time values must be Numbers, not Integers, as they can be too large for Integers on 32 bit platforms.
1 parent acc085e commit 50e88d0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/node_os.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ static Handle<Value> GetCPUInfo(const Arguments& args) {
116116
for (i = 0; i < count; i++) {
117117
Local<Object> times_info = Object::New();
118118
times_info->Set(String::New("user"),
119-
Integer::New(cpu_infos[i].cpu_times.user));
119+
Number::New(cpu_infos[i].cpu_times.user));
120120
times_info->Set(String::New("nice"),
121-
Integer::New(cpu_infos[i].cpu_times.nice));
121+
Number::New(cpu_infos[i].cpu_times.nice));
122122
times_info->Set(String::New("sys"),
123-
Integer::New(cpu_infos[i].cpu_times.sys));
123+
Number::New(cpu_infos[i].cpu_times.sys));
124124
times_info->Set(String::New("idle"),
125-
Integer::New(cpu_infos[i].cpu_times.idle));
125+
Number::New(cpu_infos[i].cpu_times.idle));
126126
times_info->Set(String::New("irq"),
127-
Integer::New(cpu_infos[i].cpu_times.irq));
127+
Number::New(cpu_infos[i].cpu_times.irq));
128128

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

0 commit comments

Comments
 (0)