- if (t->stamp_path) {
- _cleanup_close_ int fd = -1;
-
- mkdir_parents_label(t->stamp_path, 0755);
-
- /* Update the file atime + mtime, if we can */
- fd = open(t->stamp_path, O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644);
- if (fd >= 0) {
- struct timespec ts[2];
-
- timespec_store(&ts[0], t->last_trigger.realtime);
- ts[1] = ts[0];
-
- futimens(fd, ts);
- }
- }
+ if (t->stamp_path)
+ touch_file(t->stamp_path, true, t->last_trigger.realtime, UID_INVALID, GID_INVALID, 0);