aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoni <matzeton@googlemail.com>2017-01-06 19:31:35 +0100
committertoni <matzeton@googlemail.com>2017-01-06 19:31:35 +0100
commit6f09693776abb8cd7aebc7a62f704c80c0058c59 (patch)
treef6760e161f2c1fb3584ea6f0a44d7dd0e0312155
parent71db2f9ecf7f33014ce02a44f6aa0db01e616fba (diff)
fixed compile error if compiling with mips-gcc
-rw-r--r--dummyshell.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/dummyshell.c b/dummyshell.c
index 28c64f3..835fc27 100644
--- a/dummyshell.c
+++ b/dummyshell.c
@@ -1,5 +1,5 @@
/*
- * build with: gcc -Wall -O2 -D_HAS_MSG=1 -D_HAS_HOSTENT=1 -D_HAS_SIGNAL=1 -D_HAS_UTMP=1 -D_HAS_SYSINFO -ffunction-sections -fdata-sections -ffast-math -fomit-frame-pointer dummyshell.c -o dummyshell
+ * build with: gcc -Wall -O2 -D_GNU_SOURCE=1 -D_HAS_CMD=1 -D_HAS_MSG=1 -D_HAS_HOSTENT=1 -D_HAS_SIGNAL=1 -D_HAS_UTMP=1 -D_HAS_SYSINFO -ffunction-sections -fdata-sections -ffast-math -fomit-frame-pointer dummyshell.c -o dummyshell
* strip -s dummyshell
*/
@@ -10,8 +10,7 @@
#include <fcntl.h>
#include <time.h>
#include <ctype.h> /* isprint(...) */
-#include <stropts.h> /* ioctl(...) */
-#include <sys/ioctl.h>
+#include <sys/ioctl.h> /* ioctl(...) */
#include <stdint.h> /* UINT8_MAX */
#include <string.h> /* memset(...) */
#include <sys/types.h>
@@ -118,7 +117,7 @@ static void print_cmds(void)
size_t idx = 0;
printf("\33[2K\r[COMMANDS]\n");
while ( cmds[idx++].path != NULL ) {
- printf(" [%lu] %s\n", idx-1, ( cmds[idx-1].name != NULL ? cmds[idx-1].name : "unknown" ));
+ printf(" [%lu] %s\n", (unsigned long int)idx-1, ( cmds[idx-1].name != NULL ? cmds[idx-1].name : "unknown" ));
}
}