From: Cedric Date: Sun, 20 Mar 2016 11:12:11 +0000 (+0100) Subject: i3-dmenu-desktop: do not die on failed open X-Git-Tag: 4.13~108^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fpull%2F2266%2Fhead;p=i3%2Fi3 i3-dmenu-desktop: do not die on failed open --- diff --git a/i3-dmenu-desktop b/i3-dmenu-desktop index a0549ead..3b81cb20 100755 --- a/i3-dmenu-desktop +++ b/i3-dmenu-desktop @@ -25,7 +25,11 @@ binmode STDERR, ':utf8'; # reads in a whole file sub slurp { my ($filename) = @_; - open(my $fh, '<', $filename) or die "$!"; + my $fh; + if (!open($fh, '<', $filename)) { + warn "Could not open $filename: $!"; + return undef; + } local $/; my $result; eval {