Skip to content

Commit

Permalink
nic_updateable: Move clearing of update to write_recap
Browse files Browse the repository at this point in the history
for readability (the logic that uses the `update` boolean should be
responsible for clearing it).
  • Loading branch information
rhansen committed Sep 2, 2024
1 parent 5256a1d commit 25fac76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ddclient.in
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,7 @@ sub write_recap {
# `$recap{$h}` doesn't exist, and that check is done before the force-if-config-changed
# check.)
if (!exists $recap{$h} || $config{$h}{'update'}) {
delete($config{$h}{'update'});
$recap{$h} = {};
for my $v (keys(%$vars)) {
next if !$vars->{$v}{recap} || !defined(opt($v, $h));
Expand Down Expand Up @@ -3606,7 +3607,7 @@ sub nic_updateable {
}
}

delete($config{$host}{$_}) for qw(status-ipv4 status-ipv6 update);
delete($config{$host}{$_}) for qw(status-ipv4 status-ipv6);
if ($update) {
$config{$host}{'update'} = 1;
$config{$host}{'atime'} = $now;
Expand Down
1 change: 0 additions & 1 deletion t/update_nics.pl
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ sub run_httpd {
Names => ['*got', '*want']));
}
my %want_cfg = (host => {
$tc->{want_update} ? (update => 1) : (),
%cfg,
%{$tc->{want_cfg_changes} // {}},
});
Expand Down

0 comments on commit 25fac76

Please sign in to comment.