[systemd-commits] 3 commits - src/fsckd src/shared
Tom Gundersen
tomegun at kemper.freedesktop.org
Mon Mar 16 10:33:54 PDT 2015
src/fsckd/fsckd.c | 13 ++++++++++---
src/shared/util.c | 4 ++++
src/shared/util.h | 2 ++
3 files changed, 16 insertions(+), 3 deletions(-)
New commits:
commit e26169bd48c64753510a1194abdf4fb5dc907123
Author: Didier Roche <didrocks at ubuntu.com>
Date: Tue Mar 10 10:05:19 2015 +0100
fsckd: check if plymouth is running before attempting connection
diff --git a/src/fsckd/fsckd.c b/src/fsckd/fsckd.c
index f24715c..6b35fc2 100644
--- a/src/fsckd/fsckd.c
+++ b/src/fsckd/fsckd.c
@@ -231,9 +231,12 @@ static int manager_connect_plymouth(Manager *m) {
union sockaddr_union sa = PLYMOUTH_SOCKET;
int r;
+ if (!plymouth_running())
+ return 0;
+
/* try to connect or reconnect if sending a message */
if (m->plymouth_fd >= 0)
- return 0;
+ return 1;
m->plymouth_fd = socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0);
if (m->plymouth_fd < 0)
@@ -278,6 +281,9 @@ static int manager_send_plymouth_message(Manager *m, const char *message) {
r = manager_connect_plymouth(m);
if (r < 0)
return r;
+ /* 0 means that plymouth isn't running, do not send any message yet */
+ else if (r == 0)
+ return 0;
if (!m->plymouth_cancel_sent) {
commit 186c9f993af7d9c643cccd7ee8f202f4df949cde
Author: Didier Roche <didrocks at ubuntu.com>
Date: Tue Mar 10 08:58:23 2015 +0100
fsckd: Don't use strjoina on gettext() call
diff --git a/src/fsckd/fsckd.c b/src/fsckd/fsckd.c
index 3c587a3..f24715c 100644
--- a/src/fsckd/fsckd.c
+++ b/src/fsckd/fsckd.c
@@ -272,7 +272,7 @@ static int plymouth_send_message(int plymouth_fd, const char *message, bool upda
}
static int manager_send_plymouth_message(Manager *m, const char *message) {
- const char *plymouth_cancel_message = NULL;
+ const char *plymouth_cancel_message = NULL, *l10n_cancel_message = NULL;
int r;
r = manager_connect_plymouth(m);
@@ -288,7 +288,8 @@ static int manager_send_plymouth_message(Manager *m, const char *message) {
m->plymouth_cancel_sent = true;
- plymouth_cancel_message = strjoina("fsckd-cancel-msg:", _("Press Ctrl+C to cancel all filesystem checks in progress"));
+ l10n_cancel_message = _("Press Ctrl+C to cancel all filesystem checks in progress");
+ plymouth_cancel_message = strjoina("fsckd-cancel-msg:", l10n_cancel_message);
r = plymouth_send_message(m->plymouth_fd, plymouth_cancel_message, false);
if (r < 0)
commit a88c8750b3f0618036782b31a184c27c80bcb38d
Author: Tom Gundersen <teg at jklm.no>
Date: Mon Mar 16 18:29:26 2015 +0100
shared - reinstate plymouth_running()
This will be used by fsckd. This reverts part of
031886edfc6e96ab778c241035a8d00fb0de99d3.
diff --git a/src/shared/util.c b/src/shared/util.c
index 3f3ca90..5cbbe8f 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -4228,6 +4228,10 @@ bool nulstr_contains(const char*nulstr, const char *needle) {
return false;
}
+bool plymouth_running(void) {
+ return access("/run/plymouth/pid", F_OK) >= 0;
+}
+
char* strshorten(char *s, size_t l) {
assert(s);
diff --git a/src/shared/util.h b/src/shared/util.h
index 749bd0e..d229e1e 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -549,6 +549,8 @@ int kill_and_sigcont(pid_t pid, int sig);
bool nulstr_contains(const char*nulstr, const char *needle);
+bool plymouth_running(void);
+
bool hostname_is_valid(const char *s) _pure_;
char* hostname_cleanup(char *s, bool lowercase);
More information about the systemd-commits
mailing list