fd.c (292dd876ee765c478b27c93cc51e93a558ed58bf) | fd.c (5e7672ec3f059f764fcc5c78216e24bb16c44dba) |
---|---|
1/* 2 * Copyright (C) 2001 Jeff Dike (jdike@karaya.com) 3 * Licensed under the GPL 4 */ 5 6#include <stdio.h> 7#include <stdlib.h> 8#include <unistd.h> --- 6 unchanged lines hidden (view full) --- 15 16struct fd_chan { 17 int fd; 18 int raw; 19 struct termios tt; 20 char str[sizeof("1234567890\0")]; 21}; 22 | 1/* 2 * Copyright (C) 2001 Jeff Dike (jdike@karaya.com) 3 * Licensed under the GPL 4 */ 5 6#include <stdio.h> 7#include <stdlib.h> 8#include <unistd.h> --- 6 unchanged lines hidden (view full) --- 15 16struct fd_chan { 17 int fd; 18 int raw; 19 struct termios tt; 20 char str[sizeof("1234567890\0")]; 21}; 22 |
23static void *fd_init(char *str, int device, struct chan_opts *opts) | 23static void *fd_init(char *str, int device, const struct chan_opts *opts) |
24{ 25 struct fd_chan *data; 26 char *end; 27 int n; 28 29 if(*str != ':'){ 30 printk("fd_init : channel type 'fd' must specify a file " 31 "descriptor\n"); --- 40 unchanged lines hidden (view full) --- 72 CATCH_EINTR(err = tcsetattr(fd, TCSAFLUSH, &data->tt)); 73 if(err) 74 printk("Failed to restore terminal state - " 75 "errno = %d\n", -err); 76 data->raw = 0; 77 } 78} 79 | 24{ 25 struct fd_chan *data; 26 char *end; 27 int n; 28 29 if(*str != ':'){ 30 printk("fd_init : channel type 'fd' must specify a file " 31 "descriptor\n"); --- 40 unchanged lines hidden (view full) --- 72 CATCH_EINTR(err = tcsetattr(fd, TCSAFLUSH, &data->tt)); 73 if(err) 74 printk("Failed to restore terminal state - " 75 "errno = %d\n", -err); 76 data->raw = 0; 77 } 78} 79 |
80struct chan_ops fd_ops = { | 80const struct chan_ops fd_ops = { |
81 .type = "fd", 82 .init = fd_init, 83 .open = fd_open, 84 .close = fd_close, 85 .read = generic_read, 86 .write = generic_write, 87 .console_write = generic_console_write, 88 .window_size = generic_window_size, --- 14 unchanged lines hidden --- | 81 .type = "fd", 82 .init = fd_init, 83 .open = fd_open, 84 .close = fd_close, 85 .read = generic_read, 86 .write = generic_write, 87 .console_write = generic_console_write, 88 .window_size = generic_window_size, --- 14 unchanged lines hidden --- |