File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 23
23
use POSIX;
24
24
use File::Basename;
25
25
use File::Spec;
26
+ use File::Temp qw/ tempfile/ ;
26
27
use Cwd ' abs_path' ;
27
28
use Term::ANSIColor qw( :constants) ;
28
29
use Getopt::Long qw( :config no_auto_abbrev) ;
@@ -221,14 +222,16 @@ sub get_kernel_config_option
221
222
{
222
223
my ($option ) = @_ ;
223
224
my $value = " " ;
225
+ my $tmp_fh ;
224
226
my $tmp_file = " " ;
225
227
my @config_files ;
226
228
227
229
# Allow --kernel-config-file to override.
228
230
if ($kernel_config_file ne " " ) {
229
231
@config_files = ($kernel_config_file );
230
232
} elsif (-R " /proc/config.gz" ) {
231
- my $tmp_file = " /tmp/tmpkconf" ;
233
+ ($tmp_fh , $tmp_file ) = tempfile(" config.gz-XXXXXX" ,
234
+ UNLINK => 1);
232
235
233
236
if (system (" gunzip < /proc/config.gz > $tmp_file " )) {
234
237
dprint(" system(gunzip < /proc/config.gz) failed\n " );
@@ -250,10 +253,6 @@ sub get_kernel_config_option
250
253
}
251
254
}
252
255
253
- if ($tmp_file ne " " ) {
254
- system (" rm -f $tmp_file " );
255
- }
256
-
257
256
return $value ;
258
257
}
259
258
You can’t perform that action at this time.
0 commit comments