Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dhtnet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
dhtnet
Commits
651a4c6f
Commit
651a4c6f
authored
1 year ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
dsh: support macOS for pipe()
Change-Id: If2dbf456f0f2dbc7f04e1dec4db7986ad10f6f54
parent
bd09c995
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
tools/dsh/dsh.cpp
+14
-2
14 additions, 2 deletions
tools/dsh/dsh.cpp
with
14 additions
and
2 deletions
tools/dsh/dsh.cpp
+
14
−
2
View file @
651a4c6f
...
...
@@ -28,13 +28,25 @@ const int READ_END = 0;
const
int
WRITE_END
=
1
;
void
create_pipe
(
int
pipe
[
2
])
create_pipe
(
int
a
pipe
[
2
])
{
if
(
pipe2
(
pipe
,
O_CLOEXEC
)
==
-
1
)
{
#ifdef __APPLE__
if
(
pipe
(
apipe
)
<
0
)
perror
(
"pipe"
);
if
(
fcntl
(
apipe
[
0
],
F_SETFD
,
FD_CLOEXEC
)
<
0
)
perror
(
"unable to set pipe FD_CLOEXEC"
);
if
(
fcntl
(
apipe
[
1
],
F_SETFD
,
FD_CLOEXEC
)
<
0
)
perror
(
"unable to set pipe FD_CLOEXEC"
);
#else
if
(
pipe2
(
apipe
,
O_CLOEXEC
)
==
-
1
)
{
perror
(
"pipe2"
);
exit
(
EXIT_FAILURE
);
}
#endif
}
void
child_proc
(
const
int
in_pipe
[
2
],
const
int
out_pipe
[
2
],
...
...
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