mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-04 18:31:31 +00:00
datastore: use libc's timespec constants instead of redefinition
Use the UTIME_NOW and UTIME_OMIT constants defined in libc crate instead of redefining them. This improves consistency, as utimesat and its timespec parameter are also defined via the libc crate. Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
parent
62ff4f2472
commit
f098814876
@ -220,19 +220,16 @@ impl ChunkStore {
|
||||
// unwrap: only `None` in unit tests
|
||||
assert!(self.locker.is_some());
|
||||
|
||||
const UTIME_NOW: i64 = (1 << 30) - 1;
|
||||
const UTIME_OMIT: i64 = (1 << 30) - 2;
|
||||
|
||||
let times: [libc::timespec; 2] = [
|
||||
// access time -> update to now
|
||||
libc::timespec {
|
||||
tv_sec: 0,
|
||||
tv_nsec: UTIME_NOW,
|
||||
tv_nsec: libc::UTIME_NOW,
|
||||
},
|
||||
// modification time -> keep as is
|
||||
libc::timespec {
|
||||
tv_sec: 0,
|
||||
tv_nsec: UTIME_OMIT,
|
||||
tv_nsec: libc::UTIME_OMIT,
|
||||
},
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user