]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
small cleanup
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 11 Jan 2016 12:20:15 +0000 (13:20 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 12 Jan 2016 09:19:17 +0000 (10:19 +0100)
remove the unlink_socket variable and it's check as they wher
always true, as error and the end of the programm can only be
reached when the socket is already set up.
Also unlinking an non existent file does not result in any error.

also some whitespace cleanup in the surrounding area.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/watchdog-mux.c

index a74e90c25aaa7dc346dd7eb620caab535849aa0d..16eef641c63da268f00cbf8f617cc26b39dfb0e5 100644 (file)
@@ -106,8 +106,7 @@ main(void)
     socklen_t peer_addr_size;
     struct epoll_event ev, events[MAX_EVENTS];
     int listen_sock, nfds, epollfd, sigfd;
-    int unlink_socket = 0;
-    
+
     struct stat fs;
 
     if (stat(WD_ACTIVE_MARKER, &fs) == 0) {
@@ -157,7 +156,6 @@ main(void)
 
     /* always unlink socket path then create socket */
     unlink(WD_SOCK_PATH);
-    unlink_socket = 1;
 
     listen_sock = socket(AF_UNIX, SOCK_STREAM, 0);
     if (listen_sock == -1) {
@@ -350,15 +348,13 @@ main(void)
         fprintf(stderr, "clean exit\n");
         watchdog_close();
     }
-    
-    if (unlink_socket)
-           unlink(WD_SOCK_PATH);
-    
+
+    unlink(WD_SOCK_PATH);
+
     exit(EXIT_SUCCESS);
 
 err:
-    if (unlink_socket)
-           unlink(WD_SOCK_PATH);
+    unlink(WD_SOCK_PATH);
 
     exit(EXIT_FAILURE);
 }