From: Stefan Schantl Date: Mon, 23 Nov 2015 09:23:55 +0000 (+0100) Subject: Socket.pm: Fix detection and deletion of an existing socket file. X-Git-Tag: 2.0~77 X-Git-Url: http://git.ipfire.org/?p=people%2Fstevee%2Fguardian.git;a=commitdiff_plain;h=3ae3ca9b01d8de4a99b4dc412fd22ea787420e92;hp=45bf2a03c98db3aeb415d4315933f238748ecb53;ds=sidebyside Socket.pm: Fix detection and deletion of an existing socket file. Signed-off-by: Stefan Schantl --- diff --git a/modules/Socket.pm b/modules/Socket.pm index c8a17c9..ea1c723 100644 --- a/modules/Socket.pm +++ b/modules/Socket.pm @@ -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.