Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
95e5fb9c
Commit
95e5fb9c
authored
18 years ago
by
Christopher J. Morrone
Browse files
Options
Downloads
Patches
Plain Diff
Fix to eio to handle POLLNVAL properly.
parent
1fc8cab7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/eio.c
+4
-8
4 additions, 8 deletions
src/common/eio.c
src/common/eio.h
+10
-0
10 additions, 0 deletions
src/common/eio.h
with
14 additions
and
8 deletions
src/common/eio.c
+
4
−
8
View file @
95e5fb9c
...
...
@@ -290,13 +290,7 @@ _poll_handle_event(short revents, eio_obj_t *obj, List objList)
bool
read_called
=
false
;
bool
write_called
=
false
;
if
(
revents
&
POLLNVAL
)
{
debug
(
"POLLNVAL on fd %d, shutting down eio object"
,
obj
->
fd
);
obj
->
shutdown
=
true
;
return
;
}
if
(
revents
&
POLLERR
)
{
if
(
revents
&
POLLERR
||
revents
&
POLLNVAL
)
{
if
(
obj
->
ops
->
handle_error
)
{
(
*
obj
->
ops
->
handle_error
)
(
obj
,
objList
);
}
else
if
(
obj
->
ops
->
handle_read
)
{
...
...
@@ -306,7 +300,9 @@ _poll_handle_event(short revents, eio_obj_t *obj, List objList)
(
*
obj
->
ops
->
handle_write
)
(
obj
,
objList
);
write_called
=
true
;
}
else
{
debug
(
"No handler for POLLERR"
);
debug
(
"No handler for %s on fd %d"
,
revents
&
POLLERR
?
"POLLERR"
:
"POLLNVAL"
,
obj
->
fd
);
obj
->
shutdown
=
true
;
}
return
;
...
...
This diff is collapsed.
Click to expand it.
src/common/eio.h
+
10
−
0
View file @
95e5fb9c
...
...
@@ -39,6 +39,16 @@ typedef struct eio_handle_components eio_handle_t;
*
* handle_*() functions also pass the List of io_obj's from the event loop
*
* If either "handle_error" (for POLLERR and POLLNVAL) or "handle_close"
* (for POLLHUP) are not defined, the eio server will fallback to handle_read
* if defined, and fallback to handle_write if handle_read is not defined
* either.
*
* If there are no handlers at all when POLLERR or POLLNVAL occurs, the eio
* server will set the eio_obj_t shutdown flag to "true". Keep in mind
* that the shutdown flag is essentially just an advisory flag. The
* "readable" and "writable" functions have the final say over whether a
* file descriptor will continue to be polled.
*/
struct
io_operations
{
bool
(
*
readable
)(
eio_obj_t
*
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment