emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/w32.c,v


From: Eli Zaretskii
Subject: [Emacs-diffs] Changes to emacs/src/w32.c,v
Date: Sat, 09 Aug 2008 18:19:28 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Eli Zaretskii <eliz>    08/08/09 18:19:28

Index: w32.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/w32.c,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -b -r1.148 -r1.149
--- w32.c       9 Aug 2008 17:53:00 -0000       1.148
+++ w32.c       9 Aug 2008 18:19:28 -0000       1.149
@@ -3608,16 +3608,29 @@
   utime_usec = fmodl (tem2, 1000000.0L);
   utime_sec = tem2 * 0.000001L;
   *utime = ltime (utime_sec, utime_usec);
-  tem = (convert_time_raw (ft_creation) - utc_base) * 0.1L;
+  tem = convert_time_raw (ft_creation);
+  /* Process no 4 (System) returns zero creation time.  */
+  if (tem)
+    tem = (tem - utc_base) * 0.1;
   ctime_usec = fmodl (tem, 1000000.0L);
   ctime_sec = tem * 0.000001L;
   *ctime = ltime (ctime_sec, ctime_usec);
+  if (tem)
   tem = (convert_time_raw (ft_current) - utc_base) * 0.1L - tem;
   etime_usec = fmodl (tem, 1000000.0L);
   etime_sec = tem * 0.000001L;
   *etime = ltime (etime_sec, etime_usec);
 
+  if (tem)
+    {
   *pcpu = 100.0 * (tem1 + tem2) / tem;
+      if (*pcpu > 100)
+       *pcpu = 100.0;
+    }
+  else
+    *pcpu = 0;
+
+  return 1;
 }
 
 Lisp_Object




reply via email to

[Prev in Thread] Current Thread [Next in Thread]