Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mininet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olaf Bergmann
mininet
Commits
ce167380
Commit
ce167380
authored
10 years ago
by
cody burkard
Browse files
Options
Downloads
Patches
Plain Diff
clean up logic for backgrounded processes
parent
c11d5773
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mininet/node.py
+6
-10
6 additions, 10 deletions
mininet/node.py
with
6 additions
and
10 deletions
mininet/node.py
+
6
−
10
View file @
ce167380
...
...
@@ -239,16 +239,12 @@ def sendCmd( self, *args, **kwargs ):
# Replace empty commands with something harmless
cmd
=
'
echo -n
'
self
.
lastCmd
=
cmd
if
printPid
and
not
isShellBuiltin
(
cmd
):
if
len
(
cmd
)
>
0
and
cmd
[
-
1
]
==
'
&
'
:
# print ^A{pid}\n so monitor() can set lastPid
cmd
+=
'
printf
"
\\
001%d
\\
012
"
$!
'
else
:
cmd
=
'
mnexec -p
'
+
cmd
# if a builtin command is backgrounded, it yields a PID
elif
isShellBuiltin
(
cmd
):
if
len
(
cmd
)
>
0
and
cmd
[
-
1
]
==
'
&
'
:
cmd
+=
'
printf
"
\\
001%d
\\
012
"
$!
'
# if a builtin command is backgrounded, it still yields a PID
if
len
(
cmd
)
>
0
and
cmd
[
-
1
]
==
'
&
'
:
# print ^A{pid}\n so monitor() can set lastPid
cmd
+=
'
printf
"
\\
001%d
\\
012
"
$!
'
elif
printPid
and
not
isShellBuiltin
(
cmd
):
cmd
=
'
mnexec -p
'
+
cmd
self
.
write
(
cmd
+
'
\n
'
)
self
.
lastPid
=
None
self
.
waiting
=
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