* process.c (rb_proc_times): avoid WindowsXP crash using volatile
variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a3c545a7bc
commit
4d676cf76f
12
process.c
12
process.c
@ -1261,13 +1261,17 @@ rb_proc_times(obj)
|
|||||||
# endif
|
# endif
|
||||||
#endif /* HZ */
|
#endif /* HZ */
|
||||||
struct tms buf;
|
struct tms buf;
|
||||||
|
VALUE volatile utime = rb_float_new((double)buf.tms_utime / HZ);
|
||||||
|
VALUE volatile stime = rb_float_new((double)buf.tms_stime / HZ);
|
||||||
|
VALUE volatile cutime = rb_float_new((double)buf.tms_cutime / HZ);
|
||||||
|
VALUE volatile sctime = rb_float_new((double)buf.tms_cstime / HZ);
|
||||||
|
|
||||||
times(&buf);
|
times(&buf);
|
||||||
return rb_struct_new(S_Tms,
|
return rb_struct_new(S_Tms,
|
||||||
rb_float_new((double)buf.tms_utime / HZ),
|
utime,
|
||||||
rb_float_new((double)buf.tms_stime / HZ),
|
stime,
|
||||||
rb_float_new((double)buf.tms_cutime / HZ),
|
cutime,
|
||||||
rb_float_new((double)buf.tms_cstime / HZ));
|
sctime);
|
||||||
#else
|
#else
|
||||||
rb_notimplement();
|
rb_notimplement();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user