]> git.ipfire.org Git - people/stevee/guardian.git/commitdiff
Socket.pm: Fix detection and deletion of an existing socket file.
authorStefan Schantl <stefan.schantl@ipfire.org>
Mon, 23 Nov 2015 09:23:55 +0000 (10:23 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Mon, 23 Nov 2015 09:23:55 +0000 (10:23 +0100)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
modules/Socket.pm

index c8a17c9ad91fae103e9a62686c6d871fe0a1191b..ea1c723f806cc6908e365bdd02192a05e46c8c77 100644 (file)
@@ -37,9 +37,9 @@ sub Server () {
        }
 
        # Delete an existing socket file.
-       if (-s "$socketfile") {
-               unlink "$socketfile" 
-               or die "Could not release existing socket file: $@\n";
+       if (-e "$socketfile") {
+               unlink $socketfile
+               or die "Could not release existing socket file: $!\n";
        }
 
        # Create a new UNIX socket.