Added check for empty timeservers field

This commit is contained in:
Jamie Cameron
2007-04-18 18:40:42 +00:00
parent 6132516154
commit 23c100c8bb
3 changed files with 4 additions and 0 deletions

View File

@@ -9,3 +9,5 @@ Command-line options for the hwclock command can now be specified on the Module
Added an API for getting and setting the system and hardware times, for calling by other modules.
---- Changes since 1.210 ----
When the hardware or system time is not editable due to module access control restrictions, the times are now displayed (but cannot be changed).
---- Changes since 1.340 ----
Added check for empty timeservers field.

View File

@@ -50,6 +50,7 @@ if( $in{ 'action' } eq $text{ 'action_apply' } )
} elsif( $in{ 'action' } eq $text{ 'index_sync' }) {
# Sync with a time server
$access{'ntp'} || &error($text{'acl_nontp'});
$in{'timeserver'} =~ /\S/ || &error($text{'error_etimeserver'});
$err = &sync_time($in{'timeserver'}, $in{'hardware'});
&error($err) if ($err);

View File

@@ -43,6 +43,7 @@ error_hw=Can't set the hardware time : $1
error_sync=Can't sync with system time : $1
error_ediff=Time server different with local time is too large : $1 days
error_entp=NTP time synchronization failed : $1
error_etimeserver=No time servers to sync with entered
log_set_date=Set system time to $1
log_set_hwclock=Set hardware clock to $1