diff options
author | Jeff Dike <jdike@addtoit.com> | 2006-07-10 13:45:11 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-10 22:24:24 +0200 |
commit | 8e64d96aeb495709c13307e2d79f3ee37e96aa4e (patch) | |
tree | 41532136fdd081d561343be876d3068464821910 /arch/um/os-Linux | |
parent | [PATCH] uml: remove spinlock wrapper functions (diff) | |
download | linux-8e64d96aeb495709c13307e2d79f3ee37e96aa4e.tar.xz linux-8e64d96aeb495709c13307e2d79f3ee37e96aa4e.zip |
[PATCH] uml: remove os_isatty
os_isatty can be made to disappear by moving maybe_sigio_broken from kernel to
user code. This also lets write_sigio_workaround become static.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/os-Linux')
-rw-r--r-- | arch/um/os-Linux/irq.c | 5 | ||||
-rw-r--r-- | arch/um/os-Linux/sigio.c | 14 |
2 files changed, 13 insertions, 6 deletions
diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c index 64c114b02701..7555bf9c33d9 100644 --- a/arch/um/os-Linux/irq.c +++ b/arch/um/os-Linux/irq.c @@ -52,11 +52,6 @@ int os_waiting_for_events(struct irq_fd *active_fds) return n; } -int os_isatty(int fd) -{ - return isatty(fd); -} - int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds) { if (pollfds_num == pollfds_size) { diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c index 00e9388e947a..0d2422a7d72c 100644 --- a/arch/um/os-Linux/sigio.c +++ b/arch/um/os-Linux/sigio.c @@ -233,7 +233,7 @@ static struct pollfd *setup_initial_poll(int fd) return p; } -void write_sigio_workaround(void) +static void write_sigio_workaround(void) { unsigned long stack; struct pollfd *p; @@ -314,6 +314,18 @@ out_close1: close(l_write_sigio_fds[1]); } +void maybe_sigio_broken(int fd, int read) +{ + if(!isatty(fd)) + return; + + if((read || pty_output_sigio) && (!read || pty_close_sigio)) + return; + + write_sigio_workaround(); + add_sigio_fd(fd, read); +} + void sigio_cleanup(void) { if(write_sigio_pid != -1){ |