summaryrefslogtreecommitdiffstats
path: root/lib/plymouth-ctrl.c
diff options
context:
space:
mode:
authorRuediger Meier2017-06-08 22:29:32 +0200
committerRuediger Meier2017-06-15 09:13:04 +0200
commitdb981e3e0da2b872071f5299e0b4dc4067553040 (patch)
tree003986666c18aafb392f2020fbb3fc57147e85a0 /lib/plymouth-ctrl.c
parentlibmount: fix warning "set but not used" (diff)
downloadkernel-qcow2-util-linux-db981e3e0da2b872071f5299e0b4dc4067553040.tar.gz
kernel-qcow2-util-linux-db981e3e0da2b872071f5299e0b4dc4067553040.tar.xz
kernel-qcow2-util-linux-db981e3e0da2b872071f5299e0b4dc4067553040.zip
lib: style cosmetics plymouth-ctrl.c
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'lib/plymouth-ctrl.c')
-rw-r--r--lib/plymouth-ctrl.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/plymouth-ctrl.c b/lib/plymouth-ctrl.c
index 0e60341a1..2d3deda07 100644
--- a/lib/plymouth-ctrl.c
+++ b/lib/plymouth-ctrl.c
@@ -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: