fix a bug gcc 8 picked up: use ~LOCK_NB to look for LOCK_UN,

like the rest of the code does.

from uwe@.
This commit is contained in:
mrg 2019-10-04 16:27:00 +00:00
parent 5e58365557
commit 03c86659de
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: flock.c,v 1.11 2014/08/18 09:16:35 christos Exp $ */
/* $NetBSD: flock.c,v 1.12 2019/10/04 16:27:00 mrg Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: flock.c,v 1.11 2014/08/18 09:16:35 christos Exp $");
__RCSID("$NetBSD: flock.c,v 1.12 2019/10/04 16:27:00 mrg Exp $");
#include <stdio.h>
#include <string.h>
@ -231,7 +231,7 @@ main(int argc, char *argv[])
break;
default:
if ((lock & LOCK_NB) == LOCK_UN)
if ((lock & ~LOCK_NB) == LOCK_UN)
usage("Unlock is only valid for descriptors");
if (strcmp(argv[1], "-c") == 0 ||
strcmp(argv[1], "--command") == 0) {