lockfile: Fix inverted comparison.
authorBen Pfaff <blp@nicira.com>
Wed, 11 Mar 2009 21:33:32 +0000 (14:33 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 11 Mar 2009 21:44:57 +0000 (14:44 -0700)
remove_lockfile() returns a negative errno value on error, 0 on success.

Minor style fix also.

lib/lockfile.c

index d98e97a5ae8f3ad6c8bf0a907c7081ede69ad7bd..031f2453c9914f578ecb9c3abfbd6bc69eae8305 100644 (file)
@@ -111,11 +111,12 @@ create_lockfile(const char *name)
     struct passwd *pwd;
     mode_t old_umask;
     uid_t uid;
+    int retval;
     int fd;
 
     /* Remove an existing lockfile if it was created by us. */
-    int retval = remove_lockfile(name);
-    if (!retval) {
+    retval = remove_lockfile(name);
+    if (retval) {
         return retval;
     }