commit 7ae61bb85943506b67fbcb941349a2eeca182975
parent 8c59487a9c1e1d264d78da4d841fada50b2a3ec7
Author: leitner <leitner>
Date: Mon, 26 May 2003 22:19:11 +0000
close fifos in shutdown
import str_len alias to strlen from libowfat-cvs
Diffstat:
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/shutdown.c b/shutdown.c
@@ -116,6 +116,7 @@ int minit_serviceDown(char *service) {
if (i == 0) __write2("\t\tdone\n");
else __write2("\t\tfailed\n");
}
+ close(infd); close(outfd);
return 0;
}
@@ -127,7 +128,7 @@ int minit_shutdown(int level) {
while (lockf(infd, F_LOCK, 1)) {
__write2("could not acquire lock!\n");
sleep(1);
- }
+ }
}
return minit_serviceDown(level?"halt":"reboot");
diff --git a/str_len.c b/str_len.c
@@ -1,6 +1,9 @@
#include "str.h"
-unsigned int str_len(const char *in) {
+#ifdef __dietlibc__
+unsigned int str_len(const char* in) __attribute__((alias("strlen")));
+#else
+unsigned int str_len(const char* in) {
register const char* t=in;
for (;;) {
if (!*t) break; ++t;
@@ -10,3 +13,4 @@ unsigned int str_len(const char *in) {
}
return t-in;
}
+#endif