From: Michael Tremer Date: Wed, 16 Sep 2009 13:41:52 +0000 (+0200) Subject: Serial console: Automatic fixes of whitespace. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c76a67a0fa268bfd2a8e7d17a7a9c82945e05ed2;p=ipfire-3.x.git Serial console: Automatic fixes of whitespace. --- diff --git a/src/initscripts/src/console_check.c b/src/initscripts/src/console_check.c index 9ecbb036d..f03cd9019 100644 --- a/src/initscripts/src/console_check.c +++ b/src/initscripts/src/console_check.c @@ -55,15 +55,15 @@ int termcmp(struct termios *a, struct termios *b) { cfgetispeed(a) != cfgetispeed(b) || cfgetospeed(a) != cfgetospeed(b)) return 1; return memcmp(a->c_cc, b->c_cc, sizeof(a->c_cc)); -} +} int get_serial_speed(int fd) { struct termios mode; - + if (!tcgetattr(fd, &mode)) { int i; speed_t speed; - + speed = cfgetospeed(&mode); for (i = 0; speed_map[i].value != 0; i++) if (speed_map[i].speed == speed) @@ -151,18 +151,18 @@ out: int emit_console_event(char *dev, int speed) { char *args[] = { "initctl", "emit", "--no-wait", "serial-console-available", NULL, NULL, NULL }; - + args[4] = dev; if (speed) asprintf(&args[5],"%d",speed); execv("/sbin/initctl", args); - return 1; + return 1; } int main(int argc, char **argv) { char *device; int speed; - + if (argc < 2) { printf("usage: console_check \n"); exit(1); diff --git a/src/initscripts/src/securetty.c b/src/initscripts/src/securetty.c index f1505076f..9bdc8c226 100644 --- a/src/initscripts/src/securetty.c +++ b/src/initscripts/src/securetty.c @@ -19,12 +19,12 @@ int open_and_lock_securetty() { int fd; struct flock lock; struct sigaction act, oldact; - + lock.l_type = F_WRLCK; lock.l_whence = SEEK_SET; lock.l_start = 0; lock.l_len = 0; - + fd = open("/etc/securetty", O_RDWR); if (fd == -1) { syslog(LOG_ERR, "Couldn't open /etc/securetty: %s",strerror(errno)); @@ -51,7 +51,7 @@ int rewrite_securetty(char *terminal) { int fd; char *buf, *pos; struct stat sbuf; - + fd = open_and_lock_securetty(); if (fd == -1) return 1;