fix fubar'd error check
authorGrazvydas Ignotas <notasas@gmail.com>
Fri, 12 Dec 2014 00:15:58 +0000 (02:15 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 12 Dec 2014 00:15:58 +0000 (02:15 +0200)
always closing fd 0, which sometimes happens to be inotify fd, nice..

lib/pnd_utility.c

index b011cdd..17fb322 100644 (file)
@@ -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..
   }