commit-inetutils
[Top][All Lists]
Advanced

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

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-154-gb189c


From: Simon Josefsson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-154-gb189c9e
Date: Fri, 24 Aug 2012 07:08:17 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  b189c9e69b5727a8325651b1a40dd3c849093a27 (commit)
      from  8073192d2df6eb3e8d018e8ed68df4e1df5d75ba (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=b189c9e69b5727a8325651b1a40dd3c849093a27


commit b189c9e69b5727a8325651b1a40dd3c849093a27
Author: Simon Josefsson <address@hidden>
Date:   Fri Aug 24 09:07:17 2012 +0200

    Don't busy loop when waiting for data from client.
    
    Tiny patch from Petr Malát <address@hidden>.

diff --git a/ChangeLog b/ChangeLog
index 53e22b1..dec4809 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-24  Petr Malát  <address@hidden>  (tiny change)
+
+       * telnetd/utility.c (io_drain): New variable rfds.
+       (io_drain): Use select to wait for data to be available.
+
 2012-08-22  Petr Malát  <address@hidden>  (tiny change)
 
        * telnet/telnet.c (options, do_dont_resp, will_wont_resp):
diff --git a/telnetd/utility.c b/telnetd/utility.c
index b96a18f..1128cea 100644
--- a/telnetd/utility.c
+++ b/telnetd/utility.c
@@ -402,21 +402,23 @@ pty_read (void)
 void
 io_drain (void)
 {
+  fd_set rfds;
+
   DEBUG (debug_report, 1, debug_output_data ("td: ttloop\r\n"));
   if (nfrontp - nbackp > 0)
     netflush ();
 
-again:
+  FD_ZERO(&rfds);
+  FD_SET(net, &rfds);
+  if (1 != select(net + 1, &rfds, NULL, NULL, NULL))
+    {
+      syslog (LOG_INFO, "ttloop:  select: %m\n");
+      exit (EXIT_FAILURE);
+    }
+
   ncc = read (net, netibuf, sizeof netibuf);
   if (ncc < 0)
     {
-      if (errno == EAGAIN)
-       {
-         /*
-          * syslog (LOG_INFO, "ttloop: retrying");
-          */
-         goto again;
-       }
       syslog (LOG_INFO, "ttloop:  read: %m\n");
       exit (EXIT_FAILURE);
     }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |    5 +++++
 telnetd/utility.c |   18 ++++++++++--------
 2 files changed, 15 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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