summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-01-06 18:27:14 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-01-06 18:27:14 +0100
commit635db1be84f28c56f603d574c60cab53894387f9 (patch)
treede050fe0c5267cec5faab59f585b0c1723cb2ff5
parenta8c28033890bcd661d78ca8190cc2552ddbacda1 (diff)
downloadrvnit-635db1be84f28c56f603d574c60cab53894387f9.tar.gz
rvnit-635db1be84f28c56f603d574c60cab53894387f9.tar.xz
rvnit-635db1be84f28c56f603d574c60cab53894387f9.zip
sort services
-rw-r--r--rvnit.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/rvnit.c b/rvnit.c
index 9b2d0ab..3f70458 100644
--- a/rvnit.c
+++ b/rvnit.c
@@ -396,6 +396,15 @@ timedwait(int *wstatus, int secs)
 }
 
 int
+svcmp(void const *a, void const *b)
+{
+	const struct entry *sv_a = a;
+	const struct entry *sv_b = b;
+
+	return strcmp(sv_a->name, sv_b->name);
+}
+
+int
 main()
 {
 	pipe(selflogfd);
@@ -443,6 +452,8 @@ main()
 
 	closedir(dir);
 
+	qsort(services, MAX_SV, sizeof services[0], svcmp);
+
 	LOG("booting");
 
 	for (level = 0; level < 100; level++) {