summaryrefslogtreecommitdiff
path: root/src/fsck
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-05-10 18:08:57 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-05-14 05:01:38 +0900
commit1861986a3bf78df26aee37635083cf1507be4b24 (patch)
tree5f99ecd0e8bc519285e4557c89dde81278e05452 /src/fsck
parent28ae8da97240c0048f03ed516d64fe064a7fc161 (diff)
downloadsystemd-1861986a3bf78df26aee37635083cf1507be4b24.tar.gz
tree-wide: port various users over to connect_unix_path()
Let's make use of our new helper, and thus allow longer paths.
Diffstat (limited to 'src/fsck')
-rw-r--r--src/fsck/fsck.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c
index 745d01ff50..46ccc9781f 100644
--- a/src/fsck/fsck.c
+++ b/src/fsck/fsck.c
@@ -226,20 +226,17 @@ static int process_progress(int fd, FILE* console) {
}
static int fsck_progress_socket(void) {
- static const union sockaddr_union sa = {
- .un.sun_family = AF_UNIX,
- .un.sun_path = "/run/systemd/fsck.progress",
- };
-
_cleanup_close_ int fd = -1;
+ int r;
fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (fd < 0)
return log_warning_errno(errno, "socket(): %m");
- if (connect(fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)) < 0)
- return log_full_errno(IN_SET(errno, ECONNREFUSED, ENOENT) ? LOG_DEBUG : LOG_WARNING,
- errno, "Failed to connect to progress socket %s, ignoring: %m", sa.un.sun_path);
+ r = connect_unix_path(fd, AT_FDCWD, "/run/systemd/fsck.progress");
+ if (r < 0)
+ return log_full_errno(IN_SET(r, -ECONNREFUSED, -ENOENT) ? LOG_DEBUG : LOG_WARNING,
+ r, "Failed to connect to progress socket, ignoring: %m");
return TAKE_FD(fd);
}