summaryrefslogtreecommitdiff
path: root/src/daemon/dlt_daemon_unix_socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/dlt_daemon_unix_socket.c')
-rw-r--r--src/daemon/dlt_daemon_unix_socket.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/daemon/dlt_daemon_unix_socket.c b/src/daemon/dlt_daemon_unix_socket.c
index 0ed92ad..743035a 100644
--- a/src/daemon/dlt_daemon_unix_socket.c
+++ b/src/daemon/dlt_daemon_unix_socket.c
@@ -47,14 +47,12 @@ int dlt_daemon_unix_socket_open(int *sock, char *sock_path, int type, int mask)
struct sockaddr_un addr;
int old_mask;
- if (sock == NULL || sock_path == NULL)
- {
+ if ((sock == NULL) || (sock_path == NULL)) {
dlt_log(LOG_ERR, "dlt_daemon_unix_socket_open: arguments invalid");
return -1;
}
- if ((*sock = socket(AF_UNIX, type, 0)) == -1)
- {
+ if ((*sock = socket(AF_UNIX, type, 0)) == -1) {
dlt_log(LOG_WARNING, "unix socket: socket() error");
return -1;
}
@@ -68,14 +66,12 @@ int dlt_daemon_unix_socket_open(int *sock, char *sock_path, int type, int mask)
/* set appropriate access permissions */
old_mask = umask(mask);
- if (bind(*sock, (struct sockaddr *) &addr, sizeof(addr)) == -1)
- {
+ if (bind(*sock, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
dlt_log(LOG_WARNING, "unix socket: bind() error");
return -1;
}
- if (listen(*sock, 1) == -1)
- {
+ if (listen(*sock, 1) == -1) {
dlt_log(LOG_WARNING, "unix socket: listen error");
return -1;
}
@@ -90,8 +86,7 @@ int dlt_daemon_unix_socket_close(int sock)
{
int ret = close(sock);
- if (ret != 0)
- {
+ if (ret != 0) {
sprintf(err_string, "unix socket close failed: %s", strerror(errno));
dlt_log(LOG_WARNING, err_string);
}