ash: fix mishandling of bash-style redirects
[oweals/busybox.git] / applets / usage.c
index f2281d6997f9b8e5e372c246a72e9dcb3faa708a..d4fd12f9beb14bf012e01326349c94846b42f937 100644 (file)
@@ -1,7 +1,25 @@
 /* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2008 Denys Vlasenko.
+ *
+ * Licensed under GPLv2, see file LICENSE in this tarball for details.
+ */
 #include <unistd.h>
 
-#include "../include/autoconf.h"
+/* Just #include "autoconf.h" doesn't work for builds in separate
+ * object directory */
+#include "autoconf.h"
+
+/* Since we can't use platform.h, have to do this again by hand: */
+#if ENABLE_NOMMU
+# define BB_MMU 0
+# define USE_FOR_NOMMU(...) __VA_ARGS__
+# define USE_FOR_MMU(...)
+#else
+# define BB_MMU 1
+# define USE_FOR_NOMMU(...)
+# define USE_FOR_MMU(...) __VA_ARGS__
+#endif
 
 static const char usage_messages[] = ""
 #define MAKE_USAGE
@@ -11,6 +29,6 @@ static const char usage_messages[] = ""
 
 int main(void)
 {
-       write(1, usage_messages, sizeof(usage_messages));
+       write(STDOUT_FILENO, usage_messages, sizeof(usage_messages));
        return 0;
 }