mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
perl: Set program name to the true name instead of 'perl'.
Currently any Perl program has the handle program name field set to 'perl'. Set it to the true name (derived from $0).
This commit is contained in:
@@ -753,6 +753,12 @@ sub new {
|
||||
my $g = Sys::Guestfs::_create ($flags);
|
||||
my $self = { _g => $g, _flags => $flags };
|
||||
bless $self, $class;
|
||||
|
||||
# If we don't do this, the program name is always set to 'perl'.
|
||||
my $program = $0;
|
||||
$program =~ s{.*/}{};
|
||||
$self->set_program ($program);
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user