Diff between ae649a2b8128f09c71c296cc081b79e9b79c823b and 8ad5849da7961354378ebfded4df58aa07013247

Changed Files

File Additions Deletions Status
obexd/src/main.c +4 -8 modified

Full Patch

diff --git a/obexd/src/main.c b/obexd/src/main.c
index 455065f..24a002c 100644
--- a/obexd/src/main.c
+++ b/obexd/src/main.c
@@ -65,21 +65,17 @@ static void tty_init(int service, const gchar *root_path,
 	struct server *server;
 	struct termios options;
 	gint fd;
+	glong flags;
 
 	fd = open(devnode, O_RDWR);
 	if (fd < 0)
 		return;
 
-	fcntl(fd, F_SETFL, 0);
+	flags = fcntl(fd, F_GETFL);
+	fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
 
 	tcgetattr(fd, &options);
-
-	options.c_cflag |= (CLOCAL | CREAD);
-	options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
-	options.c_oflag &= ~OPOST;
-	options.c_cc[VMIN] = 0;
-	options.c_cc[VTIME] = 10;
-
+	cfmakeraw(&options);
 	tcsetattr(fd, TCSANOW, &options);
 
 	server = g_malloc0(sizeof(struct server));