From: Grazvydas Ignotas Date: Fri, 12 Dec 2014 00:15:58 +0000 (+0200) Subject: fix fubar'd error check X-Git-Tag: sz_173~8 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d7600dbd66bb286ad26f3e9ef624da5dd02bad4;p=pandora-libraries.git fix fubar'd error check always closing fd 0, which sometimes happens to be inotify fd, nice.. --- diff --git a/lib/pnd_utility.c b/lib/pnd_utility.c index b011cdd..17fb322 100644 --- a/lib/pnd_utility.c +++ b/lib/pnd_utility.c @@ -375,7 +375,7 @@ unsigned char pnd_lock ( char *lockname ) { snprintf ( fullpath, PATH_MAX, "%s/%s", PND_LOCK_PATH, lockname ); - if ( ( fd = creat ( fullpath, 0444 ) < 0 ) ) { + if ( ( fd = creat ( fullpath, 0444 ) ) < 0 ) { return ( 0 ); // error, yeah, I know, no way to know why it failed.. }