mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2025-04-21 12:27:27 +03:00
neocon.c: copyright update and whitespace cleanup
Now conforms to Linux kernel style.
This commit is contained in:
@@ -2,7 +2,8 @@
|
|||||||
* neocon.c - An interface for changing tty devices
|
* neocon.c - An interface for changing tty devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2008 by OpenMoko, Inc.
|
* Copyright (C) 2007, 2008 by OpenMoko, Inc.
|
||||||
* Written by Werner Almesberger <werner@openmoko.org>
|
* Copyright 2011 by Werner Almesberger
|
||||||
|
* Written by Werner Almesberger <werner@almesberger.net>
|
||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -101,12 +102,12 @@ static void make_raw(int fd, struct termios *old)
|
|||||||
perror("tcsetattr");
|
perror("tcsetattr");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
flags = fcntl(fd,F_GETFL);
|
flags = fcntl(fd, F_GETFL);
|
||||||
if (flags < 0) {
|
if (flags < 0) {
|
||||||
perror("fcntl F_GETFL");
|
perror("fcntl F_GETFL");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (fcntl(fd,F_SETFL,flags & ~O_NONBLOCK) < 0) {
|
if (fcntl(fd, F_SETFL, flags & ~O_NONBLOCK) < 0) {
|
||||||
perror("fcntl F_GETFL");
|
perror("fcntl F_GETFL");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@@ -235,8 +236,7 @@ static int copy(int in, int out, int from_user, int single)
|
|||||||
if (from_user) {
|
if (from_user) {
|
||||||
if (scan(buffer, got))
|
if (scan(buffer, got))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (log)
|
if (log)
|
||||||
do_log(buffer, got);
|
do_log(buffer, got);
|
||||||
}
|
}
|
||||||
@@ -354,7 +354,8 @@ int main(int argc, char *const *argv)
|
|||||||
if (fd > 0) {
|
if (fd > 0) {
|
||||||
char buf[1024]; /* enough :-) */
|
char buf[1024]; /* enough :-) */
|
||||||
|
|
||||||
sprintf(buf, "\r\r[Open %s]\r\n", ttys[curr_tty]);
|
sprintf(buf, "\r\r[Open %s]\r\n",
|
||||||
|
ttys[curr_tty]);
|
||||||
write_string(buf);
|
write_string(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user