Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/ldpd clear the error condition



details:   https://anonhg.NetBSD.org/src/rev/ef0753baf0d2
branches:  trunk
changeset: 766123:ef0753baf0d2
user:      kefren <kefren%NetBSD.org@localhost>
date:      Thu Jun 16 06:05:47 2011 +0000

description:
clear the error condition
KNF a little bit

diffstat:

 usr.sbin/ldpd/socketops.c |  17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diffs (31 lines):

diff -r 8d06a907a6b4 -r ef0753baf0d2 usr.sbin/ldpd/socketops.c
--- a/usr.sbin/ldpd/socketops.c Thu Jun 16 04:38:21 2011 +0000
+++ b/usr.sbin/ldpd/socketops.c Thu Jun 16 06:05:47 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: socketops.c,v 1.8 2011/06/15 13:24:48 kefren Exp $ */
+/* $NetBSD: socketops.c,v 1.9 2011/06/16 06:05:47 kefren Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -657,13 +657,14 @@
                                p = get_ldp_peer_by_socket(pfd[i].fd);
                                if (!p)
                                        continue;
-                               if ((getsockopt(pfd[i].fd, SOL_SOCKET, SO_ERROR,
-                                       &sock_error, &sock_error_size) != 0) ||
-                                           (sock_error)) {
-                                               ldp_peer_holddown(p);
-                                       } else {
-                                               p->state = LDP_PEER_CONNECTED;
-                                               send_initialize(p);
+                               if (getsockopt(pfd[i].fd, SOL_SOCKET, SO_ERROR,
+                                   &sock_error, &sock_error_size) != 0 ||
+                                   sock_error != 0) {
+                                       ldp_peer_holddown(p);
+                                       sock_error = 0;
+                               } else {
+                                       p->state = LDP_PEER_CONNECTED;
+                                       send_initialize(p);
                                }
                        }
                }



Home | Main Index | Thread Index | Old Index