summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaul <paul>2004-10-29 08:29:36 +0000
committerpaul <paul>2004-10-29 08:29:36 +0000
commitdccfb1902c5ed8126a304b9ca12830a378933d1f (patch)
tree69028a740d83992fa6e5092066d3c92672bcd0ff
parent28f79728b6ec46f545fc9978a9238e6d58c7a5d2 (diff)
2004-10-29 Paul Jakma <paul@dishone.st>
* vty.c: Move setting of sock to O_NONBLOCK from vty_serv_un to vtysh_accept, where sock is the actual fd we wanted to set to O_NONBLOCK, ie the /connected/ vtysh unix socket.
-rw-r--r--lib/ChangeLog6
-rw-r--r--lib/vty.c12
2 files changed, 12 insertions, 6 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 8a9fb247..28c0c005 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-29 Paul Jakma <paul@dishone.st>
+
+ * vty.c: Move setting of sock to O_NONBLOCK from vty_serv_un
+ to vtysh_accept, where sock is the actual fd we wanted to set to
+ O_NONBLOCK, ie the /connected/ vtysh unix socket.
+
2004-10-23 Hasso Tepper <hasso at quagga.net>
* zclient.c: Unbreak reading interface update message. Might fix
diff --git a/lib/vty.c b/lib/vty.c
index d21f38c9..7db1aa91 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -1902,12 +1902,6 @@ vty_serv_un (const char *path)
return;
}
- /* set to non-blocking*/
- if ( ((flags = fcntl (sock, F_GETFL)) == -1)
- || (fcntl (sock, F_SETFL, flags|O_NONBLOCK) == -1) )
- zlog_warn ("vty_serv_un: could not set vty socket to non-blocking,"
- " %s", strerror (errno));
-
umask (old_mask);
zprivs_get_ids(&ids);
@@ -1952,6 +1946,12 @@ vtysh_accept (struct thread *thread)
return -1;
}
+ /* set to non-blocking*/
+ if ( ((flags = fcntl (sock, F_GETFL)) == -1)
+ || (fcntl (sock, F_SETFL, flags|O_NONBLOCK) == -1) )
+ zlog_warn ("vty_serv_un: could not set vty socket to non-blocking,"
+ " %s", strerror (errno));
+
#ifdef VTYSH_DEBUG
printf ("VTY shell accept\n");
#endif /* VTYSH_DEBUG */