rpc.lockd(8): Fix some references of the wrong lock.
authorSascha Wildner <saw@online.de>
Fri, 21 Feb 2014 16:44:36 +0000 (17:44 +0100)
committerSascha Wildner <saw@online.de>
Fri, 21 Feb 2014 16:45:18 +0000 (17:45 +0100)
fl is used later on to iterate through the lock list but here, rfl
is meant.

While here, fix a spell-o in a comment.

usr.sbin/rpc.lockd/lockd_lock.c

index 6e42507..87ae5a6 100644 (file)
@@ -585,19 +585,19 @@ do_unlock(struct file_lock *rfl)
        int error;
        int lockst;
 
-       /* unlock the file: closing is enouth ! */
+       /* unlock the file: closing is enough! */
        if (close(rfl->fd) < 0) {
                if (errno == ESTALE)
                        error = nlm4_stale_fh;
                else
                        error = nlm4_failed;
-               if ((fl->flags & LOCK_V4) == 0)
+               if ((rfl->flags & LOCK_V4) == 0)
                        error = nlm_denied;
                syslog(LOG_NOTICE,
                    "close failed (from %s): %s",
                    rfl->client_name, strerror(errno));
        } else {
-               error = (fl->flags & LOCK_V4) ?
+               error = (rfl->flags & LOCK_V4) ?
                    nlm4_granted : nlm_granted;
        }
        LIST_REMOVE(rfl, lcklst);