]> arthur.barton.de Git - bup.git/commit
Always publish utimensat in helpers when available and fix type conversions.
authorRob Browning <rlb@defaultvalue.org>
Wed, 18 Dec 2013 02:56:52 +0000 (20:56 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sat, 21 Dec 2013 17:53:03 +0000 (11:53 -0600)
commit9ce545703dda3c888081c504863308902ce8c56b
tree3268e5ea95b5c942c8831e9d555de662b8830355
parent5dfc5f8eb00873664d0a76e8680d77097e1a7cf3
Always publish utimensat in helpers when available and fix type conversions.

Previously, bup assumed a timespec was (long, long), which agrees with
glibc.info, but utimensat(2) and POSIX say it's (time_t, long).

Since the types vary (and even if they didn't, Python doesn't provide
safe "time_t" conversions), add ASSIGN_PYLONG_TO_INTEGRAL(), which
should handle safely assigning a PyLong value to any given C integral
destination, whenever it will fit -- then use that macro to handle the
utimensat arguments.

Whenever it's available, publish utimensat independently in helpers.
For now, this allows us to test utimensat directly, and in the future,
it may allow us to test bup's behavior with either utimensat or
utimes/lutimes without recompilation, whenever both are available.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/_helpers.c
lib/bup/t/txstat.py
lib/bup/xstat.py