Displaying 1 result from an estimated 1 matches for "do_runscripts".
2010 Apr 28
1
[PATCH] RFC: Running initscripts from kinit
...;;
int mnt_procfs;
int mnt_sysfs;
@@ -189,6 +193,70 @@ static const char *find_init(const char *root, const char *user)
return path;
}
+static int sort_compare(const void *a, const void *b)
+{
+ return strcmp(a, b);
+}
+
+/* Go through and run all scripts found in /etc/init.d */
+static void do_runscripts()
+{
+ DIR *dir;
+ struct dirent *dirent;
+ char **names = NULL;
+ unsigned used_count = 0;
+ unsigned total_count = 0;
+ char buf[256 + strlen(INITD) + 1];
+ int i;
+
+ dir = opendir(INITD);
+ if (!dir)
+ return;
+
+ while (1) {
+ dirent = readdir(dir);
+ if (dirent == NULL && errno !=...