summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-03-09 18:21:34 +0100
committerLennart Poettering <lennart@poettering.net>2015-03-09 18:21:34 +0100
commit705778ad6a0d1fd62bdb81fad0074199a3e25666 (patch)
tree8f8f24aada017998fd9ba57bac315ecdeadbcd0b /src
parenta922c18bce8d25f23c3614d3508f80658958a285 (diff)
fsck: unify exit path for connect_plymouth()
Diffstat (limited to 'src')
-rw-r--r--src/fsckd/fsckd.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/fsckd/fsckd.c b/src/fsckd/fsckd.c
index 3abf962eeb..cf823322a1 100644
--- a/src/fsckd/fsckd.c
+++ b/src/fsckd/fsckd.c
@@ -227,6 +227,7 @@ static int update_global_progress(Manager *m) {
"Checking in progress on %d disks (%3.1f%% complete)", m->numdevices),
m->numdevices, m->percent) < 0)
return -ENOMEM;
+
if (asprintf(&fsck_message, "fsckd:%d:%3.1f:%s", m->numdevices, m->percent, console_message) < 0)
return -ENOMEM;
@@ -260,17 +261,21 @@ static int connect_plymouth(Manager *m) {
return log_warning_errno(errno, "Connection to plymouth socket failed: %m");
if (connect(m->plymouth_fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + 1 + strlen(sa.un.sun_path+1)) < 0) {
- on_plymouth_disconnect(m);
- return log_warning_errno(errno, "Couldn't connect to plymouth: %m");
+ r = log_warning_errno(errno, "Couldn't connect to plymouth: %m");
+ goto fail;
}
r = sd_event_add_io(m->event, NULL, m->plymouth_fd, EPOLLIN, plymouth_feedback_handler, m);
if (r < 0) {
- on_plymouth_disconnect(m);
- return log_warning_errno(r, "Can't listen to plymouth socket: %m");
+ log_warning_errno(r, "Can't listen to plymouth socket: %m");
+ goto fail;
}
return 0;
+
+fail:
+ on_plymouth_disconnect(m);
+ return r;
}
static int progress_handler(sd_event_source *s, int fd, uint32_t revents, void *userdata) {