Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8e2d10e1e76d894ec73d66dd63b641ccf5f5fb67
Commit:     8e2d10e1e76d894ec73d66dd63b641ccf5f5fb67
Parent:     89fe64766ab76b02c65a806b8b5a864652493bd6
Author:     Jeff Dike <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 01:26:40 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 09:43:04 2007 -0700

    uml: tidy recently-moved code
    
    Now that the generic console operations are in a userspace file, we
    can do the following:
        directly call into libc instead of through the os_* wrappers
        eliminate os_window_size since it has only one user
    
    Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>
    Cc: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/um/drivers/chan_user.c |   30 +++++++++++++++---------------
 arch/um/include/os.h        |    1 -
 arch/um/os-Linux/file.c     |   13 -------------
 3 files changed, 15 insertions(+), 29 deletions(-)

diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
index 249c877..40271af 100644
--- a/arch/um/drivers/chan_user.c
+++ b/arch/um/drivers/chan_user.c
@@ -23,43 +23,43 @@
 
 void generic_close(int fd, void *unused)
 {
-       os_close_file(fd);
+       close(fd);
 }
 
 int generic_read(int fd, char *c_out, void *unused)
 {
        int n;
 
-       n = os_read_file(fd, c_out, sizeof(*c_out));
-
-       if(n == -EAGAIN)
+       n = read(fd, c_out, sizeof(*c_out));
+       if (n > 0)
+               return n;
+       else if (errno == EAGAIN)
                return 0;
-       else if(n == 0)
+       else if (n == 0)
                return -EIO;
-       return n;
+       return -errno;
 }
 
-/* XXX Trivial wrapper around os_write_file */
+/* XXX Trivial wrapper around write */
 
 int generic_write(int fd, const char *buf, int n, void *unused)
 {
-       return os_write_file(fd, buf, n);
+       return write(fd, buf, n);
 }
 
 int generic_window_size(int fd, void *unused, unsigned short *rows_out,
                        unsigned short *cols_out)
 {
-       int rows, cols;
+       struct winsize size;
        int ret;
 
-       ret = os_window_size(fd, &rows, &cols);
-       if(ret < 0)
-               return ret;
+       if(ioctl(fd, TIOCGWINSZ, &size) < 0)
+               return -errno;
 
-       ret = ((*rows_out != rows) || (*cols_out != cols));
+       ret = ((*rows_out != size.ws_row) || (*cols_out != size.ws_col));
 
-       *rows_out = rows;
-       *cols_out = cols;
+       *rows_out = size.ws_row;
+       *cols_out = size.ws_col;
 
        return ret;
 }
diff --git a/arch/um/include/os.h b/arch/um/include/os.h
index 930b261..bb6b7d9 100644
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -134,7 +134,6 @@ extern void os_print_error(int error, const char* str);
 extern int os_get_exec_close(int fd, int *close_on_exec);
 extern int os_set_exec_close(int fd, int close_on_exec);
 extern int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg);
-extern int os_window_size(int fd, int *rows, int *cols);
 extern int os_new_tty_pgrp(int fd, int pid);
 extern int os_get_ifname(int fd, char *namebuf);
 extern int os_set_slip(int fd);
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index c3ecc2a..f52006e 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -101,19 +101,6 @@ int os_ioctl_generic(int fd, unsigned int cmd, unsigned 
long arg)
        return err;
 }
 
-int os_window_size(int fd, int *rows, int *cols)
-{
-       struct winsize size;
-
-       if(ioctl(fd, TIOCGWINSZ, &size) < 0)
-               return -errno;
-
-       *rows = size.ws_row;
-       *cols = size.ws_col;
-
-       return 0;
-}
-
 int os_new_tty_pgrp(int fd, int pid)
 {
        if(ioctl(fd, TIOCSCTTY, 0) < 0)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to