Skip to content

Commit

Permalink
Merge pull request #142 from moetiker/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus-it authored Nov 11, 2023
2 parents 3e0c843 + 7a773aa commit 5efb8cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/Zadm/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ my $edit = sub($self, $config) {
my $suf = $self->gconf->{CONFIG}->{format} || 'json';
my $fh = File::Temp->new(SUFFIX => ".$suf", OPEN => 0);
my $file = Mojo::File->new($fh->filename);
$file->spurt($config);
$file->spew($config);

my $mtime = $file->stat->mtime;

Expand Down Expand Up @@ -330,7 +330,7 @@ sub edit($self, $zone, $prop = {}) {
# restoring the zone XML config since it was changed but something went wrong
if ($backmod && $backmod != $xml->stat->mtime) {
$self->log->warn('WARNING: restoring the zone config.');
$xml->spurt($backcfg);
$xml->spew($backcfg);

return 0;
}
Expand Down Expand Up @@ -385,7 +385,7 @@ sub edit($self, $zone, $prop = {}) {
# restoring the zone XML config since it was changed but something went wrong
if ($backmod && $backmod != $xml->stat->mtime) {
$self->log->warn('WARNING: restoring the zone config.');
$xml->spurt($backcfg);
$xml->spew($backcfg);
}

return 0;
Expand Down Expand Up @@ -433,7 +433,7 @@ sub getZfsProp($self, $ds, $prop = []) {

sub getFileType($self, $data, $suffix = '') {
my $f = Mojo::File->new(File::Temp->new($suffix ? (SUFFIX => $suffix) : ()));
$f->spurt($data);
$f->spew($data);

return $self->readProc('file', [ '-b', $f ])->[0];
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Zadm/Zone/base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ sub fw($self) {
}
else {
# ipf requires a trailing newline
$f->spurt(join ("\n", @{$self->utils->getSTDIN}), "\n");
$f->spew(join ("\n", @{$self->utils->getSTDIN}), "\n");
}

return if !-f $f || $mtime == $f->stat->mtime;
Expand Down

0 comments on commit 5efb8cd

Please sign in to comment.