mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 22:13:01 +07:00
Relocate create() from bootmisc plugin to helpers.h
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -64,12 +64,6 @@ static int is_tmpfs(char *path)
|
||||
return tmpfs;
|
||||
}
|
||||
|
||||
static void create(char *path, mode_t mode, uid_t uid, gid_t gid)
|
||||
{
|
||||
if (touch(path) || chmod(path, mode) || chown(path, uid, gid))
|
||||
_w("Failed creating %s properl.", path);
|
||||
}
|
||||
|
||||
static int do_clean(const char *fpath, const struct stat *UNUSED(sb), int UNUSED(tflag), struct FTW *ftw)
|
||||
{
|
||||
if (ftw->level == 0)
|
||||
|
||||
+7
-2
@@ -30,6 +30,7 @@
|
||||
#include <string.h> /* strerror() */
|
||||
#include <syslog.h>
|
||||
#include <sys/types.h>
|
||||
#include <lite/lite.h>
|
||||
|
||||
/*
|
||||
* Error and debug messages
|
||||
@@ -54,8 +55,6 @@ char *runlevel_string (int levels);
|
||||
int pid_alive (pid_t pid);
|
||||
char *pid_get_name (pid_t pid, char *name, size_t len);
|
||||
|
||||
void procname_set (char *name, char *args[]);
|
||||
|
||||
void print (int action, const char *fmt, ...);
|
||||
void print_desc (char *action, char *desc);
|
||||
int print_result (int fail);
|
||||
@@ -89,6 +88,12 @@ void endfsent(void);
|
||||
struct fstab *getfsent(void);
|
||||
#endif /* HAVE_GETFSENT */
|
||||
|
||||
static inline void create(char *path, mode_t mode, uid_t uid, gid_t gid)
|
||||
{
|
||||
if (touch(path) || chmod(path, mode) || chown(path, uid, gid))
|
||||
_w("Failed creating %s properly.", path);
|
||||
}
|
||||
|
||||
#endif /* FINIT_HELPERS_H_ */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user