[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: |
Thu, 19 Dec 2013 08:18:24 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 |
Paul,
Thanks for the explanations and the comment. Some things get cleared.
The intent is that we are able to deal with files left on a harddisk
from Middle Ages, that's cool :)
src/lread.c:
/* The last-modified time of the newest matching file found.
Initialize it to something less than all valid timestamps. */
struct timespec save_mtime = make_timespec (TYPE_MINIMUM (time_t), -1);
But -1 makes this struct invalid. How can we be sure that comparing an
invalid timestamp to a valid timestamp gives us the expected result?
src/systime.h:
INLINE bool
timespec_valid_p (struct timespec t)
{
return t.tv_nsec >= 0;
}
So after having this shallow look at timespec structure, I think -1
should be replaced by 0. 999999999, even if more correct, would probably
be too pedantic and less readable.
Jarek
W dniu 2013-12-18 23:45, Paul Eggert pisze:
[...]
Here's a shell transcript to illustrate:
$ touch -d 0001-12-25 Christmas-1-AD
$ ls -l oldfile
-rw-r--r--. 1 eggert eggert 0 Dec 25 0001 Christmas-1-AD
$ ls -l --time-style=+%s oldfile
-rw-r--r--. 1 eggert eggert 0 -62104665600 Christmas-1-AD
For this file, file-attributes returns the time stamp
(-947642 512 0 0), and -62104665600 == (-947642 << 16) + 512.