summaryrefslogtreecommitdiff
path: root/src/init/shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/init/shell.c')
-rw-r--r--src/init/shell.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/init/shell.c b/src/init/shell.c
index 12ec5f6..6002156 100644
--- a/src/init/shell.c
+++ b/src/init/shell.c
@@ -4,8 +4,6 @@
#define PROMPT "$ "
-static int tty_fd = 0; // TODO put in stdlib
-
static char *split(char *base) {
while (*base) {
if (*base == ' ' || *base == '\t') {
@@ -20,7 +18,7 @@ static char *split(char *base) {
static int readline(char *buf, size_t max) {
char c;
size_t pos = 0;
- while (_syscall_read(tty_fd, &c, 1, 0)) {
+ while (_syscall_read(__tty_fd, &c, 1, 0)) {
switch (c) {
case '\b':
case 0x7f:
@@ -36,7 +34,7 @@ static int readline(char *buf, size_t max) {
return pos;
default:
if (pos < max) {
- _syscall_write(tty_fd, &c, 1, 0);
+ _syscall_write(__tty_fd, &c, 1, 0);
buf[pos] = c;
pos++;
}
@@ -56,7 +54,7 @@ static void cmd_cat(const char *args) {
}
len = _syscall_read(fd, buf, len, 0);
- _syscall_write(tty_fd, buf, len, 0);
+ _syscall_write(__tty_fd, buf, len, 0);
_syscall_close(fd);
}