aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/tty_log.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/os-Linux/tty_log.c')
-rw-r--r--arch/um/os-Linux/tty_log.c16
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, &current_tty, data.len); 57 os_write_file(tty_log_fd, &current_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
73void close_tty_log(int fd, void *tty) 73void 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
118int write_tty_log(int fd, const char *buf, int len, void *tty, int is_read) 118int 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
139void log_exec(char **argv, void *tty) 139void log_exec(char **argv, void *tty)
@@ -179,7 +179,7 @@ extern void register_tty_logger(int (*opener)(void *, void *),
179static int register_logger(void) 179static 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);