diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-05-06 17:51:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 15:13:03 -0400 |
commit | ef0470c053274c343b2be8737e0146d65e17f9be (patch) | |
tree | 68809a8af1da35e3bb3530a667eea080e086fae0 /arch/um/os-Linux/tty_log.c | |
parent | 3d564047a5f45cb628ec72514f68076e532988f3 (diff) |
uml: tidy libc code
This patch lays some groundwork for the next one, which converts calls to
os_{read,write}_file into {read,write}, by doing some tidying in the affected
areas.
do_not_aio gets restructured to make the final result a bit cleaner.
There are also whitespace and other formatting fixes, fixes in error messages,
and a typo fix.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux/tty_log.c')
-rw-r--r-- | arch/um/os-Linux/tty_log.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/um/os-Linux/tty_log.c b/arch/um/os-Linux/tty_log.c index c6ba56c1560f..ae9adb1b74f2 100644 --- a/arch/um/os-Linux/tty_log.c +++ b/arch/um/os-Linux/tty_log.c | |||
@@ -55,7 +55,7 @@ int open_tty_log(void *tty, void *current_tty) | |||
55 | .usec = tv.tv_usec } ); | 55 | .usec = tv.tv_usec } ); |
56 | os_write_file(tty_log_fd, &data, sizeof(data)); | 56 | os_write_file(tty_log_fd, &data, sizeof(data)); |
57 | os_write_file(tty_log_fd, ¤t_tty, data.len); | 57 | os_write_file(tty_log_fd, ¤t_tty, data.len); |
58 | return(tty_log_fd); | 58 | return tty_log_fd; |
59 | } | 59 | } |
60 | 60 | ||
61 | sprintf(buf, "%s/%0u-%0u", tty_log_dir, (unsigned int) tv.tv_sec, | 61 | sprintf(buf, "%s/%0u-%0u", tty_log_dir, (unsigned int) tv.tv_sec, |
@@ -67,7 +67,7 @@ int open_tty_log(void *tty, void *current_tty) | |||
67 | printk("open_tty_log : couldn't open '%s', errno = %d\n", | 67 | printk("open_tty_log : couldn't open '%s', errno = %d\n", |
68 | buf, -fd); | 68 | buf, -fd); |
69 | } | 69 | } |
70 | return(fd); | 70 | return fd; |
71 | } | 71 | } |
72 | 72 | ||
73 | void close_tty_log(int fd, void *tty) | 73 | void close_tty_log(int fd, void *tty) |
@@ -101,18 +101,18 @@ static int log_chunk(int fd, const char *buf, int len) | |||
101 | n = os_write_file(fd, chunk, try); | 101 | n = os_write_file(fd, chunk, try); |
102 | if(n != try) { | 102 | if(n != try) { |
103 | if(n < 0) | 103 | if(n < 0) |
104 | return(n); | 104 | return n; |
105 | return(-EIO); | 105 | return -EIO; |
106 | } | 106 | } |
107 | if(missed != 0) | 107 | if(missed != 0) |
108 | return(-EFAULT); | 108 | return -EFAULT; |
109 | 109 | ||
110 | len -= try; | 110 | len -= try; |
111 | total += try; | 111 | total += try; |
112 | buf += try; | 112 | buf += try; |
113 | } | 113 | } |
114 | 114 | ||
115 | return(total); | 115 | return total; |
116 | } | 116 | } |
117 | 117 | ||
118 | int write_tty_log(int fd, const char *buf, int len, void *tty, int is_read) | 118 | int write_tty_log(int fd, const char *buf, int len, void *tty, int is_read) |
@@ -133,7 +133,7 @@ int write_tty_log(int fd, const char *buf, int len, void *tty, int is_read) | |||
133 | os_write_file(tty_log_fd, &data, sizeof(data)); | 133 | os_write_file(tty_log_fd, &data, sizeof(data)); |
134 | } | 134 | } |
135 | 135 | ||
136 | return(log_chunk(fd, buf, len)); | 136 | return log_chunk(fd, buf, len); |
137 | } | 137 | } |
138 | 138 | ||
139 | void log_exec(char **argv, void *tty) | 139 | void log_exec(char **argv, void *tty) |
@@ -179,7 +179,7 @@ extern void register_tty_logger(int (*opener)(void *, void *), | |||
179 | static int register_logger(void) | 179 | static int register_logger(void) |
180 | { | 180 | { |
181 | register_tty_logger(open_tty_log, write_tty_log, close_tty_log); | 181 | register_tty_logger(open_tty_log, write_tty_log, close_tty_log); |
182 | return(0); | 182 | return 0; |
183 | } | 183 | } |
184 | 184 | ||
185 | __uml_initcall(register_logger); | 185 | __uml_initcall(register_logger); |