From owner-freebsd-hackers Fri May 26 1:56:40 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from numeri.campus.luth.se (numeri.campus.luth.se [130.240.197.103]) by hub.freebsd.org (Postfix) with ESMTP id 8648F37B88A for ; Fri, 26 May 2000 01:56:36 -0700 (PDT) (envelope-from k@numeri.campus.luth.se) Received: from numeri.campus.luth.se (localhost [127.0.0.1]) by numeri.campus.luth.se (8.9.3/8.9.3) with ESMTP id LAA19351; Fri, 26 May 2000 11:01:36 +0200 (CEST) (envelope-from k@numeri.campus.luth.se) Message-Id: <200005260901.LAA19351@numeri.campus.luth.se> X-Mailer: exmh version 2.1.1 10/15/1999 To: Alexander Langer Cc: hackers@FreeBSD.ORG Subject: Re: review request: truncate(1) In-reply-to: Your message of "Thu, 25 May 2000 16:52:43 +0200." <20000525165243.A84651@cichlids.cichlids.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 26 May 2000 11:01:35 +0200 From: Johan Karlsson Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi again, I found your updated version and I look good. However, I just realised that I would get ride of the modeset variable by moving the default assignment of mode to the begining. /Johan K --- truncate.c.orig Fri May 26 10:34:54 2000 +++ truncate.c Fri May 26 10:37:52 2000 @@ -46,8 +46,9 @@ int fd; int optch; mode_t mode, *modp; - int modeset = 0; + mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; + while ((optch = getopt(argc, argv, "hm:")) != -1) switch (optch) { case 'h': @@ -59,7 +60,6 @@ umask(0); mode = getmode(modp, 0); free(modp); - modeset = 1; break; case '?': default: @@ -74,8 +74,6 @@ usage(); exit(1); } - if (!modeset) - mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; size = atol(*argv++); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message