Re: strange message before sending mail
"Kevin J. McCarthy" <[email protected]>
| Newsgroups | gmane.mail.mutt.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Aug 20, 2026 at 01:53:50AM +0200, Vincent Lefevre wrote:
>On 2026-08-19 21:05:42 +0100, Ian Collier via Mutt-dev wrote:
>> On Wed, Aug 19, 2026 at 08:36:49PM +0200, Vincent Lefevre wrote:
>> > However, is it guaranteed to be less or equal to the time given
>> > by CLOCK_REALTIME? This is not documented.
>>
>> I don't know if this counts as documentation:
>> https://www.kernel.org/doc/html/latest/core-api/timekeeping.html#coarse-and-fast-ns-access
>
>I meant by a standard, as Mutt needs to work on non-Linux systems
>as well.
>
>> > So I would say that the fix for Mutt would be
>> >
>> > void mutt_stamp_attachment(BODY *a)
>> > {
>> > - a->stamp = time(NULL);
>> > + a->stamp = time(NULL) + 1;
>> > }
>> >
>> > as suggested by Kevin.
>>
>> Agreed.
>
>There could actually be a better solution: instead of calling time(),
>why doesn't Mutt get the mtime of the file just after the editor
>has terminated or just after Mutt has created the file (in case of
>$edit_headers set)? IMHO, this would make more sense as the goal is
>to compare the value with a future value of the mtime of this file.
Thanks to everyone for the analysis and discussion. At least there is
an understandable reason for the discrepancy.
Vincent, I'm fine with converting the stamp to use stat() instead.
We'll have to have error handling code though, and in that case, perhaps
a fallback of 'time(NULL) + 1'.
--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmqGWnYACgkQre92hIAx a9o6sA/8DZ7psasYRZajMbLcc4VEDXVqXRV7YR6iNNi30WIyy923vFM/tLB9+mQV H90X16uywgKkB4wdxHaA5lAZaS2JmKodmUdkCjP9B1emyhtrrZZjoX6vpB+jwwL8 nZlNab778kAWHrHUvV69cLGD7CfSp0JJ70v7Mp1gxObi3VeH+hMiwrpELESItz1q QfHI0NclMJBUqmpNPVAXxD3UOfwCqWIer+3Taq2vhtvmUpi2JZGiSe0K3moB5isb BJJsLq6Jq0L1ZvmM4DW34XyHbzUUTfiUF8wnntC2S+777gOfmwmewEQjmTtY5shf p6W20EsddICLVm33YccoRTF/nCnYicaWHRnU70cRkTDO+bDQtp9gvI8nrmfIYnUU fpHIQxJ5HtIecGTUX+J1NI6P7HOZc6YZQK44Ll78HEcHyTW8QySYIMv7MJMzGu5v MPkdAi3pbQ5DC0iHJe0spr3BpUjruHdo0AS0L8j9jxDwa+MBvY1+qJsHqf2ZYVIv +wcqLuPUDqHx7GQH0icqgBPDmVMjJ6nt73lbkdIn8LvBQ7yvg7sa8c6wfLUlCCwB ZajelIyTi8zAsOi8OjLuHXXCdo4wayKfiYYC8QH4uUH1WbINVfswFMrrXohXytQD b24x/1jWMRIYOjxaQBGekCNd7b1z8rk2Q3IEsKEoP/o/CF9RSiM= =k7ul -----END PGP SIGNATURE-----