home: hub: mkinitfs

Download patch

ref: 79c534fc67e03ef1f0b948b548fbbc40a5d53296
parent: aed3dc48211946eeaa66761017f88756bc8f742e
author: Timo Teräs <timo.teras@iki.fi>
date: Fri Oct 23 04:46:13 CDT 2015

nlplug-findfs: make all functions static

--- a/nlplug-findfs.c
+++ b/nlplug-findfs.c
@@ -156,7 +156,7 @@
 	return fd;
 }
 
-void run_child(char **argv, char **envp)
+static void run_child(char **argv, char **envp)
 {
 	pid_t pid;
 
@@ -173,7 +173,7 @@
 }
 
 
-int load_kmod(const char *modalias)
+static int load_kmod(const char *modalias)
 {
 	static struct kmod_ctx *ctx = NULL;
 	struct kmod_list *list = NULL;
@@ -216,7 +216,7 @@
 	return count;
 }
 
-void start_mdadm(char *devnode)
+static void start_mdadm(char *devnode)
 {
 	char *mdadm_argv[] = {
 		"/sbin/mdadm",
@@ -228,7 +228,7 @@
 	run_child(mdadm_argv, default_envp);
 }
 
-void start_lvm2(char *devnode)
+static void start_lvm2(char *devnode)
 {
 	char *lvm2_argv[] = {
 		"/sbin/lvm", "vgchange",
@@ -238,7 +238,7 @@
 	run_child(lvm2_argv, default_envp);
 }
 
-void start_cryptsetup(char *devnode, char *cryptdm)
+static void start_cryptsetup(char *devnode, char *cryptdm)
 {
 	char *cryptsetup_argv[] = {
 		"/sbin/cryptsetup", "luksOpen",
@@ -272,7 +272,7 @@
 };
 
 /* pathbuf needs hold PATH_MAX chars */
-void recurse_dir(char *pathbuf, struct recurse_opts *opts)
+static void recurse_dir(char *pathbuf, struct recurse_opts *opts)
 {
 	DIR *d = opendir(pathbuf);
 	struct dirent *entry;
@@ -330,7 +330,7 @@
 	int count;
 };
 
-void bootrepo_cb(const char *path, const void *data)
+static void bootrepo_cb(const char *path, const void *data)
 {
 	struct bootrepos *repos = (struct bootrepos *)data;
 	int fd = open(repos->outfile, O_WRONLY | O_CREAT | O_APPEND);
@@ -423,8 +423,8 @@
 	return rc;
 }
 
-int searchdev(char *devname, const char *searchdev, char *bootrepos,
-	      const char *apkovls)
+static int searchdev(char *devname, const char *searchdev, char *bootrepos,
+		     const char *apkovls)
 {
 	static blkid_cache cache = NULL;
 	char *type = NULL, *label = NULL, *uuid = NULL;
@@ -487,7 +487,7 @@
 	return rc;
 }
 
-int dispatch_uevent(struct uevent *ev, struct ueventconf *conf)
+static int dispatch_uevent(struct uevent *ev, struct ueventconf *conf)
 {
 	static int timeout_increment = USB_STORAGE_TIMEOUT;
 
@@ -534,7 +534,7 @@
 	return 0;
 }
 
-int process_uevent(char *buf, const size_t len, struct ueventconf *conf)
+static int process_uevent(char *buf, const size_t len, struct ueventconf *conf)
 {
 	struct uevent ev;
 
@@ -587,7 +587,7 @@
 	return dispatch_uevent(&ev, conf);
 }
 
-void trigger_uevent_cb(const char *path, const void *data)
+static void trigger_uevent_cb(const char *path, const void *data)
 {
 	int fd = open(path, O_WRONLY);
 	write(fd, "add", 3);
@@ -594,7 +594,7 @@
 	close(fd);
 }
 
-void *trigger_thread(void *data)
+static void *trigger_thread(void *data)
 {
 	int fd = *(int *)data;
 	uint64_t ok = 1;
@@ -612,7 +612,7 @@
 	return NULL;
 }
 
-void usage(int rc)
+static void usage(int rc)
 {
 	printf("coldplug system til given device is found\n"
 	"usage: %s [options] DEVICE\n"
@@ -783,5 +783,3 @@
 
 	return found ? 0 : 1;
 }
-
-