Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
c14d9ffe
Unverified
Commit
c14d9ffe
authored
Jul 29, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: s/pipe()/pipe2()/g
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
0e8afcc0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
lxc_usernsexec.c
src/lxc/tools/lxc_usernsexec.c
+13
-13
No files found.
src/lxc/tools/lxc_usernsexec.c
View file @
c14d9ffe
...
...
@@ -303,8 +303,8 @@ int main(int argc, char *argv[])
int
pid
;
char
*
default_args
[]
=
{
"/bin/sh"
,
NULL
};
char
buf
[
1
];
int
pipe
1
[
2
],
// child tells parent it has unshared
pipe
2
[
2
];
// parent tells child it is mapped and may proceed
int
pipe
_fds1
[
2
],
/* child tells parent it has unshared */
pipe
_fds2
[
2
];
/* parent tells child it is mapped and may proceed */
lxc_log_fd
=
STDERR_FILENO
;
...
...
@@ -360,15 +360,15 @@ int main(int argc, char *argv[])
if
(
argc
<
1
)
argv
=
default_args
;
if
(
pipe
(
pipe1
)
<
0
||
pipe
(
pipe2
)
<
0
)
{
if
(
pipe
2
(
pipe_fds1
,
O_CLOEXEC
)
<
0
||
pipe2
(
pipe_fds2
,
O_CLOEXEC
)
<
0
)
{
perror
(
"pipe"
);
exit
(
EXIT_FAILURE
);
}
if
((
pid
=
fork
())
==
0
)
{
// Child.
close
(
pipe1
[
0
]);
close
(
pipe2
[
1
]);
close
(
pipe
_fds
1
[
0
]);
close
(
pipe
_fds
2
[
1
]);
opentty
(
ttyname0
,
0
);
opentty
(
ttyname1
,
1
);
opentty
(
ttyname2
,
2
);
...
...
@@ -379,11 +379,11 @@ int main(int argc, char *argv[])
return
1
;
}
buf
[
0
]
=
'1'
;
if
(
write
(
pipe1
[
1
],
buf
,
1
)
<
1
)
{
if
(
write
(
pipe
_fds
1
[
1
],
buf
,
1
)
<
1
)
{
perror
(
"write pipe"
);
exit
(
EXIT_FAILURE
);
}
if
(
read
(
pipe2
[
0
],
buf
,
1
)
<
1
)
{
if
(
read
(
pipe
_fds
2
[
0
],
buf
,
1
)
<
1
)
{
perror
(
"read pipe"
);
exit
(
EXIT_FAILURE
);
}
...
...
@@ -392,14 +392,14 @@ int main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
}
close
(
pipe1
[
1
]);
close
(
pipe2
[
0
]);
close
(
pipe
_fds
1
[
1
]);
close
(
pipe
_fds
2
[
0
]);
return
do_child
((
void
*
)
argv
);
}
close
(
pipe1
[
1
]);
close
(
pipe2
[
0
]);
if
(
read
(
pipe1
[
0
],
buf
,
1
)
<
1
)
{
close
(
pipe
_fds
1
[
1
]);
close
(
pipe
_fds
2
[
0
]);
if
(
read
(
pipe
_fds
1
[
0
],
buf
,
1
)
<
1
)
{
perror
(
"read pipe"
);
exit
(
EXIT_FAILURE
);
}
...
...
@@ -409,7 +409,7 @@ int main(int argc, char *argv[])
if
(
lxc_map_ids
(
&
active_map
,
pid
))
fprintf
(
stderr
,
"error mapping child
\n
"
);
if
(
write
(
pipe2
[
1
],
buf
,
1
)
<
0
)
{
if
(
write
(
pipe
_fds
2
[
1
],
buf
,
1
)
<
0
)
{
perror
(
"write to pipe"
);
exit
(
EXIT_FAILURE
);
}
...
...
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