Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
763a31c0
Commit
763a31c0
authored
Aug 23, 2016
by
Steven Murray
Browse files
connectWithTimeout() now handles POLLNVAL
parent
9705f748
Changes
1
Hide whitespace changes
Inline
Side-by-side
tapeserver/castor/io/io.cpp
View file @
763a31c0
...
...
@@ -951,7 +951,7 @@ int castor::io::connectWithTimeout(
const
int
pollRc
=
poll
(
&
pollFd
,
1
,
1000
*
timeout
);
if
(
-
1
==
pollRc
)
{
castor
::
exception
::
Exception
ex
;
ex
.
getMessage
()
<<
"Call to poll()
()
failed: "
ex
.
getMessage
()
<<
"Call to poll() failed: "
<<
cta
::
utils
::
errnoToString
(
errno
);
throw
ex
;
}
...
...
@@ -965,6 +965,13 @@ int castor::io::connectWithTimeout(
throw
ex
;
}
if
(
pollFd
.
revents
|
POLLNVAL
)
{
castor
::
exception
::
Exception
ex
;
ex
.
getMessage
()
<<
"Failed to connect"
": File descriptor "
<<
pollFd
.
fd
<<
" is not open"
;
throw
ex
;
}
// Use getsockopt() to check whether or not the connection completed
// successfully
//
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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