Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/flock fix a bug gcc 8 picked up: use ~LOCK_NB to loo...



details:   https://anonhg.NetBSD.org/src/rev/93dd9bf8e47f
branches:  trunk
changeset: 460029:93dd9bf8e47f
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Oct 04 16:27:00 2019 +0000

description:
fix a bug gcc 8 picked up: use ~LOCK_NB to look for LOCK_UN,
like the rest of the code does.

from uwe@.

diffstat:

 usr.bin/flock/flock.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r ed207edfd078 -r 93dd9bf8e47f usr.bin/flock/flock.c
--- a/usr.bin/flock/flock.c     Fri Oct 04 16:14:05 2019 +0000
+++ b/usr.bin/flock/flock.c     Fri Oct 04 16:27:00 2019 +0000
@@ -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 @@
                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) {



Home | Main Index | Thread Index | Old Index