Relocate create() from bootmisc plugin to helpers.h

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-01-25 19:40:06 +01:00
parent f76268dec9
commit a0e17c8f47
2 changed files with 7 additions and 8 deletions
-6
View File
@@ -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
View File
@@ -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_ */
/**