mirror of
https://github.com/systemd/systemd
synced 2024-10-15 04:24:19 +00:00
fs-util: make touch() an inline function
This commit is contained in:
parent
aba5dac372
commit
86b4e141a5
|
@ -398,10 +398,6 @@ int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gi
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int touch(const char *path) {
|
|
||||||
return touch_file(path, false, USEC_INFINITY, UID_INVALID, GID_INVALID, MODE_INVALID);
|
|
||||||
}
|
|
||||||
|
|
||||||
int symlink_idempotent(const char *from, const char *to, bool make_relative) {
|
int symlink_idempotent(const char *from, const char *to, bool make_relative) {
|
||||||
_cleanup_free_ char *relpath = NULL;
|
_cleanup_free_ char *relpath = NULL;
|
||||||
int r;
|
int r;
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "errno-util.h"
|
#include "errno-util.h"
|
||||||
#include "time-util.h"
|
#include "time-util.h"
|
||||||
|
#include "user-util.h"
|
||||||
|
|
||||||
#define MODE_INVALID ((mode_t) -1)
|
#define MODE_INVALID ((mode_t) -1)
|
||||||
|
|
||||||
|
@ -50,7 +51,10 @@ int stat_warn_permissions(const char *path, const struct stat *st);
|
||||||
RET_NERRNO(faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW))
|
RET_NERRNO(faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW))
|
||||||
|
|
||||||
int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
|
int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
|
||||||
int touch(const char *path);
|
|
||||||
|
static inline int touch(const char *path) {
|
||||||
|
return touch_file(path, false, USEC_INFINITY, UID_INVALID, GID_INVALID, MODE_INVALID);
|
||||||
|
}
|
||||||
|
|
||||||
int symlink_idempotent(const char *from, const char *to, bool make_relative);
|
int symlink_idempotent(const char *from, const char *to, bool make_relative);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue