summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/utils.c b/utils.c
index 532d7e5..f39d618 100644
--- a/utils.c
+++ b/utils.c
@@ -1,7 +1,7 @@
/*
* rhctl
*
- * Copyright (C) 2009 Christian Pointner <equinox@spreadspace.org>
+ * Copyright (C) 2009-2013 Christian Pointner <equinox@helsinki.at>
*
* This file is part of rhctl.
*
@@ -52,7 +52,7 @@ int init_command_socket(const char* path)
log_printf(ERROR, "unable to bind to '%s': %s", local.sun_path, strerror(errno));
return -1;
}
-
+
ret = listen(fd, 4);
if(ret) {
log_printf(ERROR, "unable to listen on command socket: %s", local.sun_path, strerror(errno));
@@ -60,7 +60,7 @@ int init_command_socket(const char* path)
}
log_printf(INFO, "now listening on %s for incoming commands", path);
-
+
return fd;
}
@@ -113,25 +113,18 @@ int send_string(int fd, const char* string)
int setup_tty(int fd, speed_t speed)
{
struct termios tmio;
-
+
int ret = tcgetattr(fd, &tmio);
if(ret) {
log_printf(ERROR, "Error on tcgetattr(): %s", strerror(errno));
return ret;
}
-// tmio.c_iflag |= ;
tmio.c_iflag &= ~(INLCR | ICRNL | IGNCR | IXON | IXOFF);
-
-// tmio.c_oflag |= ;
tmio.c_oflag &= ~(ONLCR | OCRNL | ONOCR | ONLRET);
-
tmio.c_cflag |= CS8 | CLOCAL | CREAD;
tmio.c_cflag &= ~(CSTOPB | PARENB);
-
-// tmio.c_lflag |= ;
tmio.c_lflag &= ~(ICANON | ECHO);
-
tmio.c_cc[VTIME] = 0;
tmio.c_cc[VMIN] = 1;
@@ -152,7 +145,7 @@ int setup_tty(int fd, speed_t speed)
log_printf(ERROR, "Error on tcsetattr(): %s", strerror(errno));
return ret;
}
-
+
ret = tcflush(fd, TCIFLUSH);
if(ret) {
log_printf(ERROR, "Error on tcflush(): %s", strerror(errno));