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

Bug#738567: uses futimens, which is supported only on linux-any



Hi,

thanks for the report!

On Mon, Feb 10, 2014 at 06:35:37PM +0100, Petr Salinger wrote:
> The apt 0.9.15.1 started to use futimens instead of previous utime.
>
> The futimens() is not supported on kfreebsd.

Could this be added to the manpage utimensat(2)? I had looked there and
assumed that by POSIX1.2008 and that it is in glibc it would be safe to
use it as utime replacement…

The suggestion came from cppcheck btw as utime is obsolete, so this might
happen a bit more often in the future if more people follow this advice.
(but only in a very picky "cppcheck --enable=all --std=posix" call)

Oh, and you don't mention utimensat, but I presume it has the same
problem (coming from the same manpage and all)…


> Please could you switch to futimes() ?
> It seems that the subsecond part is set to zero in all apt cases,
> so there is no difference between nanosecond and microsecond precision at all.

Yes, there is no difference. We have at most "seconds" precision as this
is done to 'store' the modification time we got from the server.


> The futimes() is currently supported (at least) on linux, kfreebsd, hurd.

It isn't part of any standard though, so I would worry now that we could
run into problems with it as well. I guess I will just opt to revert the
utime change for the moment - its not like we are in a hurry with that,
I was just fixing issues reported by various static analyse tools…
Or maybe utimes: We have the filename around anyway and it will
silence cppcheck (and I don't have to remember to ignore the remark).


Best regards

David Kalnischkies

Attachment: signature.asc
Description: Digital signature


Reply to: