]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib: style cosmetics plymouth-ctrl.c
authorRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 8 Jun 2017 20:29:32 +0000 (22:29 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 15 Jun 2017 07:13:04 +0000 (09:13 +0200)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
lib/plymouth-ctrl.c

index 0e60341a137026d897d1486667c0735daf15ff73..2d3deda076e9de47af653cf4afbc3437c6bdca8c 100644 (file)
@@ -60,7 +60,8 @@ static int can_read(int fd, const long timeout)
 
 static int open_un_socket_and_connect(void)
 {
-       struct sockaddr_un su = {               /* The abstract UNIX socket of plymouth */
+       /* The abstract UNIX socket of plymouth */
+       struct sockaddr_un su = {
                .sun_family = AF_UNIX,
                .sun_path = PLYMOUTH_SOCKET_PATH,
        };
@@ -73,7 +74,7 @@ static int open_un_socket_and_connect(void)
                goto err;
        }
 
-       ret = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &one, (socklen_t)sizeof(one));
+       ret = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one));
        if (ret < 0) {
                warnx(_("cannot set option for UNIX socket"));
                close(fd);
@@ -81,12 +82,9 @@ static int open_un_socket_and_connect(void)
                goto err;
        }
 
-       /*
-        * Please note that the PLYMOUTH_SOCKET_PATH has a
-        * leading NULL byte to mark it as an abstract socket
-        */
-       ret = connect(fd, (const struct sockaddr *) &su,
-                     offsetof(struct sockaddr_un, sun_path) + 1 + strlen(su.sun_path+1));
+       /* Note, the abstract PLYMOUTH_SOCKET_PATH has a leading NULL byte */
+       ret = connect(fd, (struct sockaddr *) &su,
+               offsetof(struct sockaddr_un, sun_path) + 1 + strlen(su.sun_path+1));
        if (ret < 0) {
                if (errno != ECONNREFUSED)
                        warnx(_("cannot connect on UNIX socket"));
@@ -109,9 +107,7 @@ int plymouth_command(int cmd, ...)
        sp.sa_flags = SA_RESTART;
        sigaction(SIGPIPE, &sp, &op);
 
-       /*
-        * The plymouthd does read at least two bytes.
-        */
+       /* The plymouthd does read at least two bytes. */
        command[1] = '\0';
        switch (cmd) {
        case MAGIC_PING: