Source-Changes-HG archive

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

[src/netbsd-6]: src/usr.bin/flock Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/78aa3a44e86e
branches:  netbsd-6
changeset: 775667:78aa3a44e86e
user:      riz <riz%NetBSD.org@localhost>
date:      Sun Feb 10 23:42:19 2013 +0000

description:
Pull up following revision(s) (requested by tron in ticket #807):
        usr.bin/flock/flock.c: revision 1.7
Don't crash if "flock" is used to lock a file descriptor e.g. via
"flock --nb 8".

diffstat:

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

diffs (32 lines):

diff -r de3209cd2453 -r 78aa3a44e86e usr.bin/flock/flock.c
--- a/usr.bin/flock/flock.c     Sun Feb 10 20:21:58 2013 +0000
+++ b/usr.bin/flock/flock.c     Sun Feb 10 23:42:19 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: flock.c,v 1.6.4.2 2012/11/28 21:34:36 riz Exp $        */
+/*     $NetBSD: flock.c,v 1.6.4.3 2013/02/10 23:42:19 riz Exp $        */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: flock.c,v 1.6.4.2 2012/11/28 21:34:36 riz Exp $");
+__RCSID("$NetBSD: flock.c,v 1.6.4.3 2013/02/10 23:42:19 riz Exp $");
 
 #include <stdio.h>
 #include <string.h>
@@ -212,9 +212,12 @@
                if (cls)
                        usage("Close is valid only for descriptors");
                fd = strtol(argv[0], NULL, 0);  // XXX: error checking
-               if (debug)
+               if (debug) {
                        fprintf(stderr, "descriptor %s lock %s\n",
                            argv[0], lock2name(lock));
+               }
+               break;
+
        default:
                if ((lock & LOCK_NB) == LOCK_UN)
                        usage("Unlock is only valid for descriptors");



Home | Main Index | Thread Index | Old Index