chiark / gitweb /
Remove src/fsck
[elogind.git] / src / fsckd / fsckd.c
index 3c587a3f2025358f424fbe0025691658933ce10a..6b35fc26a2f69d3eedbb6658bd78198f4bcc71fd 100644 (file)
@@ -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)
@@ -272,12 +275,15 @@ 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);
         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) {
 
@@ -288,7 +294,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)