implement relead_timezone flag
This commit is contained in:
@ -32,10 +32,6 @@ fn get_time(
|
||||
}))
|
||||
}
|
||||
|
||||
extern "C" { fn tzset(); }
|
||||
|
||||
// Note:: this needs root rights ??
|
||||
|
||||
fn set_timezone(
|
||||
param: Value,
|
||||
_info: &ApiMethod,
|
||||
@ -57,8 +53,6 @@ fn set_timezone(
|
||||
use std::os::unix::fs::symlink;
|
||||
symlink(path, "/etc/localtime")?;
|
||||
|
||||
unsafe { tzset() };
|
||||
|
||||
Ok(Value::Null)
|
||||
}
|
||||
|
||||
@ -83,7 +77,7 @@ pub fn router() -> Router {
|
||||
set_timezone,
|
||||
ObjectSchema::new("Set time zone.")
|
||||
.required("timezone", StringSchema::new("Time zone. The file '/usr/share/zoneinfo/zone.tab' contains the list of valid names."))
|
||||
).protected(true)
|
||||
).protected(true).reload_timezone(true)
|
||||
);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user