Module Name: src
Committed By: mrg
Date: Fri Oct 4 16:27:00 UTC 2019
Modified Files:
src/usr.bin/flock: flock.c
Log Message:
fix a bug gcc 8 picked up: use ~LOCK_NB to look for LOCK_UN,
like the rest of the code does.
from uwe@.
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/flock/flock.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/flock/flock.c
diff -u src/usr.bin/flock/flock.c:1.11 src/usr.bin/flock/flock.c:1.12
--- src/usr.bin/flock/flock.c:1.11 Mon Aug 18 09:16:35 2014
+++ src/usr.bin/flock/flock.c Fri Oct 4 16:27:00 2019
@@ -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) {