Browse Source

in client_nextaddr, check fd != -1 before close, just nicer this way

From: amandal@entrisphere.com
OPENBSD_4_1
henning 18 years ago
parent
commit
9e886819ac
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      src/usr.sbin/ntpd/client.c

+ 5
- 3
src/usr.sbin/ntpd/client.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: client.c,v 1.72 2006/10/21 07:28:06 henning Exp $ */
/* $OpenBSD: client.c,v 1.73 2006/10/21 07:32:46 henning Exp $ */
/* /*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -94,8 +94,10 @@ client_addr_init(struct ntp_peer *p)
int int
client_nextaddr(struct ntp_peer *p) client_nextaddr(struct ntp_peer *p)
{ {
close(p->query->fd);
p->query->fd = -1;
if (p->query->fd != -1) {
close(p->query->fd);
p->query->fd = -1;
}
if (p->addr_head.a == NULL) { if (p->addr_head.a == NULL) {
priv_host_dns(p->addr_head.name, p->id); priv_host_dns(p->addr_head.name, p->id);


Loading…
Cancel
Save