diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-05-10 18:08:57 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-05-13 22:01:38 +0200 |
commit | 1861986a3bf78df26aee37635083cf1507be4b24 (patch) | |
tree | 5f99ecd0e8bc519285e4557c89dde81278e05452 /src/fsck | |
parent | fileio: port read_file_full() to use connect_unix_path() (diff) | |
download | systemd-1861986a3bf78df26aee37635083cf1507be4b24.tar.xz systemd-1861986a3bf78df26aee37635083cf1507be4b24.zip |
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.c | 13 |
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); } |