diff --git a/perl-xCAT/xCAT/PPCrflash.pm b/perl-xCAT/xCAT/PPCrflash.pm index 89184a49c..4e080174b 100644 --- a/perl-xCAT/xCAT/PPCrflash.pm +++ b/perl-xCAT/xCAT/PPCrflash.pm @@ -12,7 +12,7 @@ use xCAT::Utils; use xCAT::TableUtils; use Getopt::Long; use File::Spec; -use POSIX qw(tmpnam); +use File::Temp; my $packages_dir = (); my $activate = (); @@ -662,7 +662,7 @@ sub rflash { ######################## # Now build a temporary file containing the stanzas to be run on the HMC ################### - my $tmp_file = tmpnam(); # the file handle of the stanza + my $tmp_file = File::Temp::tmpnam(); # the file handle of the stanza ############################## # Open the temp file ########################## diff --git a/xCAT-server/lib/xcat/plugins/xdsh.pm b/xCAT-server/lib/xcat/plugins/xdsh.pm index 2b295d144..fafcdc639 100644 --- a/xCAT-server/lib/xcat/plugins/xdsh.pm +++ b/xCAT-server/lib/xcat/plugins/xdsh.pm @@ -15,6 +15,7 @@ use strict; use Storable qw(dclone); use File::Basename; use File::Path; +use File::Temp; use POSIX; require xCAT::Table; use Data::Dumper; @@ -882,7 +883,7 @@ sub process_servicenodes_xdsh # build a tmp syncfile with # $::dshexecute -> $synfiledir . $::dshexecute # $::dshenvfile -> $synfiledir . $::dshenvfile - my $tmpsyncfile = POSIX::tmpnam . ".dsh"; + my $tmpsyncfile = File::Temp::tmpnam . ".dsh"; # if -E option my $envfile;