Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
b8a86a6a
Commit
b8a86a6a
authored
Jul 07, 2017
by
Leigh B Stoller
Browse files
Stop leaving temp files behind.
parent
2b42f5ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
apt/manage_profile.in
View file @
b8a86a6a
...
...
@@ -25,7 +25,7 @@ use English;
use
strict
;
use
Getopt::
Std
;
use
XML::
Simple
;
use
File::
Temp
qw(tempfile :POSIX
)
;
use
File::
Temp
qw(tempfile
:mktemp
:POSIX)
;
use
Data::
Dumper
;
use
CGI
;
use
POSIX
"
:sys_wait_h
";
...
...
@@ -638,7 +638,7 @@ sub ModifyProfileInternal($$$)
# For a Parameterized Profile, need to generate and store the form
# data. Only python scripts of course.
#
my
(
$fh
,
$filename
)
=
tempfile
();
my
(
$fh
,
$filename
)
=
tempfile
(
UNLINK
=>
1
);
if
(
!
defined
(
$fh
))
{
$$pmsg
=
"
Could not open temporary file for script
";
return
-
1
;
...
...
@@ -890,7 +890,7 @@ sub UpdateProfileFromRepo()
# Convert the script. If it fails we are not going to change the profile.
#
if
(
defined
(
$script
))
{
my
(
$fh
,
$filename
)
=
tempfile
();
my
(
$fh
,
$filename
)
=
tempfile
(
UNLINK
=>
1
);
if
(
!
defined
(
$fh
))
{
$profile
->
Unlock
();
fatal
("
Could not open temporary file for script
");
...
...
@@ -948,7 +948,7 @@ sub HandleScript($)
return
undef
if
(
$script
!~
/^import/m
);
my
(
$fh
,
$filename
)
=
tempfile
();
my
(
$fh
,
$filename
)
=
tempfile
(
UNLINK
=>
1
);
fatal
("
Could not open temporary file for script
")
if
(
!
defined
(
$fh
));
print
$fh
$script
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment