chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
87cacc7
)
Prep v231.2: Mask get_startup_time(), it won't work without systemd running the show...
author
Sven Eden
<yamakuzure@gmx.net>
Thu, 22 Jun 2017 16:21:16 +0000
(18:21 +0200)
committer
Sven Eden
<yamakuzure@gmx.net>
Thu, 22 Jun 2017 16:23:54 +0000
(18:23 +0200)
src/update-utmp/update-utmp.c
patch
|
blob
|
history
diff --git
a/src/update-utmp/update-utmp.c
b/src/update-utmp/update-utmp.c
index 655615fc0bf48710460fd097e6beafa6a6594e8e..af1665733f68fe852c7825a0cb735d353264ab1c 100644
(file)
--- a/
src/update-utmp/update-utmp.c
+++ b/
src/update-utmp/update-utmp.c
@@
-49,6
+49,7
@@
typedef struct Context {
#endif
} Context;
#endif
} Context;
+#if 0 /// UNNEEDED by elogind
static usec_t get_startup_time(Context *c) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
usec_t t = 0;
static usec_t get_startup_time(Context *c) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
usec_t t = 0;
@@
-68,11
+69,9
@@
static usec_t get_startup_time(Context *c) {
log_error_errno(r, "Failed to get timestamp: %s", bus_error_message(&error, r));
return 0;
}
log_error_errno(r, "Failed to get timestamp: %s", bus_error_message(&error, r));
return 0;
}
-
return t;
}
return t;
}
-#if 0 /// UNNEEDED by elogind
static int get_current_runlevel(Context *c) {
static const struct {
const int runlevel;
static int get_current_runlevel(Context *c) {
static const struct {
const int runlevel;
@@
-137,9
+136,13
@@
static int on_reboot(Context *c) {
}
#endif
}
#endif
+#if 0 /// systemd hasn't started the system, so elogind always uses NOW()
/* If this call fails it will return 0, which
* utmp_put_reboot() will then fix to the current time */
t = get_startup_time(c);
/* If this call fails it will return 0, which
* utmp_put_reboot() will then fix to the current time */
t = get_startup_time(c);
+#else
+ t = now(CLOCK_REALTIME);
+#endif // 0
q = utmp_put_reboot(t);
if (q < 0) {
q = utmp_put_reboot(t);
if (q < 0) {