Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/find use O_CLOEXEC, wrap long line.



details:   https://anonhg.NetBSD.org/src/rev/9fca294818af
branches:  trunk
changeset: 784310:9fca294818af
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jan 24 17:50:08 2013 +0000

description:
use O_CLOEXEC, wrap long line.

diffstat:

 usr.bin/find/main.c |  11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r cc72e064e169 -r 9fca294818af usr.bin/find/main.c
--- a/usr.bin/find/main.c       Thu Jan 24 17:47:58 2013 +0000
+++ b/usr.bin/find/main.c       Thu Jan 24 17:50:08 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.30 2011/09/16 15:39:25 joerg Exp $  */
+/*     $NetBSD: main.c,v 1.31 2013/01/24 17:50:08 christos Exp $       */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -39,7 +39,7 @@
 #else
 __COPYRIGHT("@(#) Copyright (c) 1990, 1993, 1994\
  The Regents of the University of California.  All rights reserved.");
-__RCSID("$NetBSD: main.c,v 1.30 2011/09/16 15:39:25 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.31 2013/01/24 17:50:08 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -148,8 +148,7 @@
 
        *p = NULL;
 
-       if ((dotfd = open(".", O_RDONLY, 0)) == -1 ||
-           fcntl(dotfd, F_SETFD, FD_CLOEXEC) == -1)
+       if ((dotfd = open(".", O_RDONLY | O_CLOEXEC, 0)) == -1)
                err(1, ".");
 
        exit(find_execute(find_formplan(argv), start));
@@ -159,7 +158,7 @@
 usage(void)
 {
 
-       (void)fprintf(stderr,
-"usage: find [-H | -L | -P] [-dEhsXx] [-f file] file [file ...] [expression]\n");
+       (void)fprintf(stderr, "Usage: %s [-H | -L | -P] [-dEhsXx] [-f file] "
+           "file [file ...] [expression]\n", getprogname());
        exit(1);
 }



Home | Main Index | Thread Index | Old Index