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
78ed0c58
Commit
78ed0c58
authored
18 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Handle I/O for OSX, can't process stdin without polling.
parent
59e4e693
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common/eio.c
+45
-10
45 additions, 10 deletions
src/common/eio.c
with
45 additions
and
10 deletions
src/common/eio.c
+
45
−
10
View file @
78ed0c58
...
...
@@ -285,20 +285,55 @@ _poll_dispatch(struct pollfd *pfds, unsigned int nfds, eio_obj_t *map[],
static
void
_poll_handle_event
(
short
revents
,
eio_obj_t
*
obj
,
List
objList
)
{
if
((
revents
&
POLLERR
)
&&
obj
->
ops
->
handle_error
)
{
if
((
*
obj
->
ops
->
handle_error
)
(
obj
,
objList
)
<
0
)
return
;
if
(
revents
&
POLLNVAL
)
{
debug
(
"POLLNVAL on fd %d, shutting down eio object"
,
obj
->
fd
);
obj
->
shutdown
=
true
;
return
;
}
if
(
revents
&
POLLERR
)
{
if
(
obj
->
ops
->
handle_error
)
{
(
*
obj
->
ops
->
handle_error
)
(
obj
,
objList
);
}
else
if
(
obj
->
ops
->
handle_read
)
{
(
*
obj
->
ops
->
handle_read
)
(
obj
,
objList
);
}
else
if
(
obj
->
ops
->
handle_write
)
{
(
*
obj
->
ops
->
handle_write
)
(
obj
,
objList
);
}
else
{
debug
(
"No handler for POLLERR"
);
obj
->
shutdown
=
true
;
}
return
;
}
if
(
revents
&
POLLHUP
)
{
if
(
obj
->
ops
->
handle_close
)
{
(
*
obj
->
ops
->
handle_close
)
(
obj
,
objList
);
}
else
if
(
obj
->
ops
->
handle_read
)
{
(
*
obj
->
ops
->
handle_read
)
(
obj
,
objList
);
}
else
if
(
obj
->
ops
->
handle_write
)
{
(
*
obj
->
ops
->
handle_write
)
(
obj
,
objList
);
}
else
{
debug
(
"No handler for POLLHUP"
);
obj
->
shutdown
=
true
;
}
}
if
((
revents
&
POLLHUP
)
&&
obj
->
ops
->
handle_close
)
{
(
*
obj
->
ops
->
handle_close
)
(
obj
,
objList
);
}
else
if
(((
revents
&
POLLIN
)
||
(
revents
&
POLLHUP
))
&&
obj
->
ops
->
handle_read
)
{
(
*
obj
->
ops
->
handle_read
)
(
obj
,
objList
);
if
(
revents
&
POLLIN
)
{
if
(
obj
->
ops
->
handle_read
)
{
(
*
obj
->
ops
->
handle_read
)
(
obj
,
objList
);
}
else
{
debug
(
"No handler for POLLIN"
);
obj
->
shutdown
=
true
;
}
}
if
((
revents
&
POLLOUT
)
&&
obj
->
ops
->
handle_write
)
{
(
*
obj
->
ops
->
handle_write
)
(
obj
,
objList
);
if
(
revents
&
POLLOUT
)
{
if
(
obj
->
ops
->
handle_write
)
{
(
*
obj
->
ops
->
handle_write
)
(
obj
,
objList
);
}
else
{
debug
(
"No handler for POLLOUT"
);
obj
->
shutdown
=
true
;
}
}
}
...
...
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