mirror of
https://github.com/troglobit/finit.git
synced 2026-11-03 13:28:27 +00:00
Relocate create() from bootmisc plugin to helpers.h
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
f76268dec9
commit
a0e17c8f47
2 files changed
+7
-8
No files matched your search
@@ -64,12 +64,6 @@ static int is_tmpfs(char *path)
|
|||||||
return tmpfs;
|
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)
|
static int do_clean(const char *fpath, const struct stat *UNUSED(sb), int UNUSED(tflag), struct FTW *ftw)
|
||||||
{
|
{
|
||||||
if (ftw->level == 0)
|
if (ftw->level == 0)
|
||||||
|
|||||||
+7
-2
@@ -30,6 +30,7 @@
|
|||||||
#include <string.h> /* strerror() */
|
#include <string.h> /* strerror() */
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <lite/lite.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Error and debug messages
|
* Error and debug messages
|
||||||
@@ -54,8 +55,6 @@ char *runlevel_string (int levels);
|
|||||||
int pid_alive (pid_t pid);
|
int pid_alive (pid_t pid);
|
||||||
char *pid_get_name (pid_t pid, char *name, size_t len);
|
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 (int action, const char *fmt, ...);
|
||||||
void print_desc (char *action, char *desc);
|
void print_desc (char *action, char *desc);
|
||||||
int print_result (int fail);
|
int print_result (int fail);
|
||||||
@@ -89,6 +88,12 @@ void endfsent(void);
|
|||||||
struct fstab *getfsent(void);
|
struct fstab *getfsent(void);
|
||||||
#endif /* HAVE_GETFSENT */
|
#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_ */
|
#endif /* FINIT_HELPERS_H_ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user