chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
man: Document missing options
[elogind.git]
/
src
/
timedate
/
timedatectl.c
diff --git
a/src/timedate/timedatectl.c
b/src/timedate/timedatectl.c
index 281c0524da7d6eabfd3092885a6cbd3c32a34d6e..be3b8b4da303290e2398cd99421f9ba3195e47c2 100644
(file)
--- a/
src/timedate/timedatectl.c
+++ b/
src/timedate/timedatectl.c
@@
-51,7
+51,7
@@
static void pager_open_if_enabled(void) {
if (arg_no_pager)
return;
if (arg_no_pager)
return;
- pager_open();
+ pager_open(
false
);
}
static void polkit_agent_open_if_enabled(void) {
}
static void polkit_agent_open_if_enabled(void) {
@@
-68,12
+68,12
@@
typedef struct StatusInfo {
const char *timezone;
bool local_rtc;
bool ntp;
const char *timezone;
bool local_rtc;
bool ntp;
+ bool can_ntp;
} StatusInfo;
static bool ntp_synced(void) {
} StatusInfo;
static bool ntp_synced(void) {
- struct timex txc;
+ struct timex txc
= {}
;
- zero(txc);
if (adjtimex(&txc) < 0)
return false;
if (adjtimex(&txc) < 0)
return false;
@@
-153,7
+153,7
@@
static void print_status_info(StatusInfo *i) {
" RTC in local TZ: %s\n",
strna(i->timezone),
a,
" RTC in local TZ: %s\n",
strna(i->timezone),
a,
-
yes_no(i->ntp)
,
+
i->can_ntp ? yes_no(i->ntp) : "n/a"
,
yes_no(ntp_synced()),
yes_no(i->local_rtc));
yes_no(ntp_synced()),
yes_no(i->local_rtc));
@@
-228,6
+228,8
@@
static int status_property(const char *name, DBusMessageIter *iter, StatusInfo *
i->local_rtc = b;
else if (streq(name, "NTP"))
i->ntp = b;
i->local_rtc = b;
else if (streq(name, "NTP"))
i->ntp = b;
+ else if (streq(name, "CanNTP"))
+ i->can_ntp = b;
}
}
}
}
@@
-239,7
+241,7
@@
static int show_status(DBusConnection *bus, char **args, unsigned n) {
const char *interface = "";
int r;
DBusMessageIter iter, sub, sub2, sub3;
const char *interface = "";
int r;
DBusMessageIter iter, sub, sub2, sub3;
- StatusInfo info;
+ StatusInfo info
= {}
;
assert(args);
assert(args);
@@
-263,7
+265,6
@@
static int show_status(DBusConnection *bus, char **args, unsigned n) {
return -EIO;
}
return -EIO;
}
- zero(info);
dbus_message_iter_recurse(&iter, &sub);
while (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_INVALID) {
dbus_message_iter_recurse(&iter, &sub);
while (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_INVALID) {
@@
-425,7
+426,6
@@
static int list_timezones(DBusConnection *bus, char **args, unsigned n) {
_cleanup_fclose_ FILE *f = NULL;
_cleanup_strv_free_ char **zones = NULL;
size_t n_zones = 0;
_cleanup_fclose_ FILE *f = NULL;
_cleanup_strv_free_ char **zones = NULL;
size_t n_zones = 0;
- char **i;
assert(args);
assert(n == 1);
assert(args);
assert(n == 1);
@@
-487,8
+487,7
@@
static int list_timezones(DBusConnection *bus, char **args, unsigned n) {
pager_open_if_enabled();
strv_sort(zones);
pager_open_if_enabled();
strv_sort(zones);
- STRV_FOREACH(i, zones)
- puts(*i);
+ strv_print(zones);
return 0;
}
return 0;
}
@@
-502,6
+501,7
@@
static int help(void) {
" --adjust-system-clock\n"
" Adjust system clock when changing local RTC mode\n"
" --no-pager Do not pipe output into a pager\n"
" --adjust-system-clock\n"
" Adjust system clock when changing local RTC mode\n"
" --no-pager Do not pipe output into a pager\n"
+ " -P --privileged Acquire privileges before execution\n"
" --no-ask-password Do not prompt for password\n"
" -H --host=[USER@]HOST Operate on remote host\n\n"
"Commands:\n"
" --no-ask-password Do not prompt for password\n"
" -H --host=[USER@]HOST Operate on remote host\n\n"
"Commands:\n"