From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by sourceware.org (Postfix) with ESMTP id 1542B3857C44 for ; Wed, 5 Aug 2020 19:08:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1542B3857C44 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-63-fitq96B8OMyLjIBQc9IG4w-1; Wed, 05 Aug 2020 15:08:17 -0400 X-MC-Unique: fitq96B8OMyLjIBQc9IG4w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1C14858; Wed, 5 Aug 2020 19:08:16 +0000 (UTC) Received: from greed.delorie.com (ovpn-112-113.phx2.redhat.com [10.3.112.113]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E5FBF65C6C; Wed, 5 Aug 2020 19:08:15 +0000 (UTC) Received: from greed.delorie.com.redhat.com (localhost [127.0.0.1]) by greed.delorie.com (8.14.7/8.14.7) with ESMTP id 075J8EBH017052; Wed, 5 Aug 2020 15:08:14 -0400 From: DJ Delorie To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v2 3/7] support: Add 'touch' command In-Reply-To: <20200805185915.2025314-3-adhemerval.zanella@linaro.org> (message from Adhemerval Zanella via Libc-alpha on Wed, 5 Aug 2020 15:59:11 -0300) Date: Wed, 05 Aug 2020 15:08:14 -0400 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 19:08:20 -0000 Adhemerval Zanella via Libc-alpha writes: > It allow creates empty files with an specific mode. > + touch MODE FILE Ok. > + - 'touch': A minimal 'touch' command to create empty files. Ok. > + else if (nt == 3 && strcmp (the_words[0], "touch") == 0) > + { > + long int m; > + errno = 0; > + m = strtol (the_words[1], NULL, 0); > + TEST_COMPARE (errno, 0); > + > + xopen (the_words[2], O_WRONLY | O_TRUNC | O_CREAT, m); > + } Needs an xclose() but otherwise ok. Reviewed-by: DJ Delorie