[Top][All Lists]

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

Re: [Emacs-diffs] trunk r115596: Minor fixes for recent openp changes.

From: Jarek Czekalski
Subject: Re: [Emacs-diffs] trunk r115596: Minor fixes for recent openp changes.
Date: Wed, 18 Dec 2013 23:07:55 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0

I have problems with understanding the new code. Especially the TYPE_MINIMUM part. Paul, maybe you could add a comment to explain why such a value must be put here? Could this be initialized to 0 or to invalid_timespec? It would be easier to understand.

When the save_mtime is invalid (nsec < 0), the result of its comparison could be undefined. Maybe this comparison never happens, however 0 value would be safer.

I have these 2 doubts. Maybe the problem comes from lack of knowledge on my side. I don't know :) Just sharing thoughts.


-  struct timespec save_mtime;
-  int save_fd = 0;
+  struct timespec save_mtime = make_timespec (TYPE_MINIMUM (time_t), -1);
+  int save_fd = -1;

-                      if (!save_fd || timespec_cmp (save_mtime, mtime) < 0)
+              if (timespec_cmp (mtime, save_mtime) <= 0)

reply via email to

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