gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r30056 - msh/src


From: gnunet
Subject: [GNUnet-SVN] r30056 - msh/src
Date: Wed, 9 Oct 2013 17:20:17 +0200

Author: harsha
Date: 2013-10-09 17:20:16 +0200 (Wed, 09 Oct 2013)
New Revision: 30056

Modified:
   msh/src/test_pty.c
Log:
- receive terminal mode settings and they set them


Modified: msh/src/test_pty.c
===================================================================
--- msh/src/test_pty.c  2013-10-09 14:42:15 UTC (rev 30055)
+++ msh/src/test_pty.c  2013-10-09 15:20:16 UTC (rev 30056)
@@ -331,7 +331,7 @@
  * Create pty, fork, setup the tty modes and exec the given binary
  */
 static int
-spawn_child ()
+spawn_child (const struct MSH_MSG_PtyMode *msg)
 {
   const char *fn;
   int master;
@@ -388,6 +388,12 @@
       GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "open");
       _exit (1);
     }
+    if (-1 == tcgetattr (slave, &tio))
+    {
+      GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "tcsetattr");
+      _exit (1);
+    }
+    parse_term_mode (msg);
     if (-1 == tcsetattr (slave, TCSANOW, &tio))
     {
       GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "tcsetattr");
@@ -450,9 +456,9 @@
     STATE_MSG,
     STATE_FORWARD
   } state;
-  static struct MSH_MSG_PtyMode *msg;
   static size_t rb;
   struct GNUNET_TIME_Relative timeout;
+  static struct MSH_MSG_PtyMode *msg;
   size_t rsize;
   
   in_receive = 0;
@@ -500,10 +506,9 @@
       rsize = msize - rb;
       if (0 != rsize)
         goto read_again;
-      parse_term_mode (msg);
+      spawn_child (msg);
       GNUNET_free (msg);
       msg = NULL;
-      spawn_child ();
       state = STATE_FORWARD;
     }
     break;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]