diff options
author | Kenny Levinsen <kl@kl.wtf> | 2022-02-26 19:37:49 +0100 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2022-02-26 19:37:49 +0100 |
commit | 466efea49bc6ab5672555c31f04b39741c502c70 (patch) | |
tree | 34cbb5f51fbbd54dc83f4ef3601c9c30bd0f03d2 /seatd | |
parent | 9bbdf0f0b8d383edd1d621507c04db0a5382a5af (diff) |
seatd: Handle socket unlink errors
This ensures early failure and better error messages.
Diffstat (limited to 'seatd')
-rw-r--r-- | seatd/seatd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/seatd/seatd.c b/seatd/seatd.c index 2a41146..ef6c781 100644 --- a/seatd/seatd.c +++ b/seatd/seatd.c @@ -144,7 +144,10 @@ int main(int argc, char *argv[]) { return 1; } else { log_infof("Removing leftover socket at %s", socket_path); - unlink(socket_path); + if (unlink(socket_path) == -1) { + log_errorf("Could not remove leftover socket: %s", strerror(errno)); + return 1; + } } } @@ -186,7 +189,9 @@ int main(int argc, char *argv[]) { ret = 0; error_socket: - unlink(socket_path); + if (unlink(socket_path) == -1) { + log_errorf("Could not remove socket: %s", strerror(errno)); + } error_server: server_finish(&server); log_info("seatd stopped"); |