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 c8a17c9..ea1c723 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.