Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / arch / um / os-Linux / sigio.c
index 0ecac56..00e9388 100644 (file)
@@ -43,13 +43,13 @@ struct pollfds {
 /* Protected by sigio_lock().  Used by the sigio thread, but the UML thread
  * synchronizes with it.
  */
-static struct pollfds current_poll = {
+struct pollfds current_poll = {
        .poll           = NULL,
        .size           = 0,
        .used           = 0
 };
 
-static struct pollfds next_poll = {
+struct pollfds next_poll = {
        .poll           = NULL,
        .size           = 0,
        .used           = 0
@@ -156,7 +156,7 @@ static void update_thread(void)
        set_signals(flags);
 }
 
-static int add_sigio_fd(int fd, int read)
+int add_sigio_fd(int fd, int read)
 {
        int err = 0, i, n, events;
 
@@ -191,13 +191,6 @@ int ignore_sigio_fd(int fd)
        struct pollfd *p;
        int err = 0, i, n = 0;
 
-       /* This is called from exitcalls elsewhere in UML - if
-        * sigio_cleanup has already run, then update_thread will hang
-        * or fail because the thread is no longer running.
-        */
-       if(write_sigio_pid == -1)
-               return -EIO;
-
        sigio_lock();
        for(i = 0; i < current_poll.used; i++){
                if(current_poll.poll[i].fd == fd) break;
@@ -222,7 +215,7 @@ int ignore_sigio_fd(int fd)
        update_thread();
  out:
        sigio_unlock();
-       return err;
+       return(err);
 }
 
 static struct pollfd *setup_initial_poll(int fd)
@@ -240,7 +233,7 @@ static struct pollfd *setup_initial_poll(int fd)
        return p;
 }
 
-static void write_sigio_workaround(void)
+void write_sigio_workaround(void)
 {
        unsigned long stack;
        struct pollfd *p;
@@ -321,24 +314,10 @@ 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);
-}
-
-static void sigio_cleanup(void)
+void sigio_cleanup(void)
 {
        if(write_sigio_pid != -1){
                os_kill_process(write_sigio_pid, 1);
                write_sigio_pid = -1;
        }
 }
-
-__uml_exitcall(sigio_cleanup);