Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
27e48d2e
Commit
27e48d2e
authored
Aug 19, 1999
by
Andreas Gustafsson
Browse files
don't test errno if there has been no error
parent
de0e5c4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/isc/unix/ifiter_ioctl.c
View file @
27e48d2e
...
@@ -85,9 +85,18 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp)
...
@@ -85,9 +85,18 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp)
iter
->
ifc
.
ifc_len
=
iter
->
bufsize
;
iter
->
ifc
.
ifc_len
=
iter
->
bufsize
;
iter
->
ifc
.
ifc_buf
=
iter
->
buf
;
iter
->
ifc
.
ifc_buf
=
iter
->
buf
;
if
(
ioctl
(
iter
->
socket
,
SIOCGIFCONF
,
(
char
*
)
&
iter
->
ifc
)
>=
0
)
if
(
ioctl
(
iter
->
socket
,
SIOCGIFCONF
,
(
char
*
)
&
iter
->
ifc
)
<
0
)
{
{
if
(
errno
!=
EINVAL
)
{
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
"get interface configuration: %s"
,
strerror
(
errno
));
result
=
ISC_R_UNEXPECTED
;
goto
ioctl_failure
;
}
/* EINVAL. Retry with a bigger buffer. */
}
else
{
/*
/*
* The ioctl succeeded.
* Some OS's just return what will fit rather
* Some OS's just return what will fit rather
* than set EINVAL if the buffer is too small
* than set EINVAL if the buffer is too small
* to fit all the interfaces in. If
* to fit all the interfaces in. If
...
@@ -99,14 +108,6 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp)
...
@@ -99,14 +108,6 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp)
<
iter
->
bufsize
)
<
iter
->
bufsize
)
break
;
break
;
}
}
if
(
errno
!=
EINVAL
)
{
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
"get interface configuration: %s"
,
strerror
(
errno
));
result
=
ISC_R_UNEXPECTED
;
goto
ioctl_failure
;
}
if
(
iter
->
bufsize
>=
IFCONF_BUFSIZE_MAX
)
{
if
(
iter
->
bufsize
>=
IFCONF_BUFSIZE_MAX
)
{
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
"get interface configuration: "
"get interface configuration: "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment