This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / um / kernel / user_util.c
index 1e7c1f1..d646f1d 100644 (file)
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <limits.h>
-#include <setjmp.h>
 #include <sys/mman.h> 
 #include <sys/stat.h>
 #include <sys/ptrace.h>
@@ -81,19 +80,20 @@ int wait_for_stop(int pid, int sig, int cont_type, void *relay)
        int status, ret;
 
        while(1){
-               CATCH_EINTR(ret = waitpid(pid, &status, WUNTRACED));
+               ret = waitpid(pid, &status, WUNTRACED);
                if((ret < 0) ||
                   !WIFSTOPPED(status) || (WSTOPSIG(status) != sig)){
                        if(ret < 0){
+                               if(errno == EINTR) continue;
                                printk("wait failed, errno = %d\n",
                                       errno);
                        }
                        else if(WIFEXITED(status)) 
-                               printk("process %d exited with status %d\n", 
-                                      pid, WEXITSTATUS(status));
+                               printk("process exited with status %d\n", 
+                                      WEXITSTATUS(status));
                        else if(WIFSIGNALED(status))
-                               printk("process %d exited with signal %d\n", 
-                                      pid, WTERMSIG(status));
+                               printk("process exited with signal %d\n", 
+                                      WTERMSIG(status));
                        else if((WSTOPSIG(status) == SIGVTALRM) ||
                                (WSTOPSIG(status) == SIGALRM) ||
                                (WSTOPSIG(status) == SIGIO) ||
@@ -109,8 +109,8 @@ int wait_for_stop(int pid, int sig, int cont_type, void *relay)
                                ptrace(cont_type, pid, 0, WSTOPSIG(status));
                                continue;
                        }
-                       else printk("process %d stopped with signal %d\n", 
-                                   pid, WSTOPSIG(status));
+                       else printk("process stopped with signal %d\n", 
+                                   WSTOPSIG(status));
                        panic("wait_for_stop failed to wait for %d to stop "
                              "with %d\n", pid, sig);
                }
@@ -118,27 +118,18 @@ int wait_for_stop(int pid, int sig, int cont_type, void *relay)
        }
 }
 
-int raw(int fd)
+int raw(int fd, int complain)
 {
        struct termios tt;
        int err;
 
-       CATCH_EINTR(err = tcgetattr(fd, &tt));
-       if (err < 0) {
-               printk("tcgetattr failed, errno = %d\n", errno);
-               return(-errno);
-       }
-
+       tcgetattr(fd, &tt);
        cfmakeraw(&tt);
-
-       CATCH_EINTR(err = tcsetattr(fd, TCSADRAIN, &tt));
-       if (err < 0) {
+       err = tcsetattr(fd, TCSANOW, &tt);
+       if((err < 0) && complain){
                printk("tcsetattr failed, errno = %d\n", errno);
                return(-errno);
        }
-
-       /* XXX tcsetattr could have applied only some changes
-        * (and cfmakeraw() is a set of changes) */
        return(0);
 }
 
@@ -161,21 +152,6 @@ void setup_hostinfo(void)
                host.release, host.version, host.machine);
 }
 
-int setjmp_wrapper(void (*proc)(void *, void *), ...)
-{
-        va_list args;
-       sigjmp_buf buf;
-       int n;
-
-       n = sigsetjmp(buf, 1);
-       if(n == 0){
-               va_start(args, proc);
-               (*proc)(&buf, &args);
-       }
-       va_end(args);
-       return(n);
-}
-
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
  * Emacs will notice this stuff at the end of the file and automatically