chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test-bus-marshal.c: do not call g_type_init() for modern glib versions
[elogind.git]
/
src
/
timedate
/
timedatectl.c
diff --git
a/src/timedate/timedatectl.c
b/src/timedate/timedatectl.c
index 281c0524da7d6eabfd3092885a6cbd3c32a34d6e..bcd935a6c0436e4656df3f5c15c60e5616f3cd7d 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,6
+68,7
@@
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) {
@@
-153,7
+154,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
+229,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;
}
}
}
}
@@
-425,7
+428,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
+489,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;
}