From patchwork Fri Jun 19 20:23:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Randall S. Becker" X-Patchwork-Id: 11615027 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DE5F314B7 for ; Fri, 19 Jun 2020 20:23:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C88C1214D8 for ; Fri, 19 Jun 2020 20:23:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=rogers.com header.i=@rogers.com header.b="gcAC+QZd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392022AbgFSUXl (ORCPT ); Fri, 19 Jun 2020 16:23:41 -0400 Received: from sonic311-19.consmr.mail.bf2.yahoo.com ([74.6.131.193]:37668 "EHLO sonic311-19.consmr.mail.bf2.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391863AbgFSUXk (ORCPT ); Fri, 19 Jun 2020 16:23:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rogers.com; s=s2048; t=1592598218; bh=5mala9jDUgOnEzAGbKMLLm4X7ae8L3df5v5mCgU8aNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject; b=gcAC+QZdM9sYkH35AXlUNSyZltTitAHpmZK08+XmZbD94k0IoDy0rU0bqp2aiTeSelqVQOxKOlW01o13K+o+HUvUEu/rJincRO1Sp7NfX8dUT6bePVF9ERkhYzvZuZVkcPZGoxSATowVAXZVZUoI5oU62C5HtrzEtVhvKKLZGY/imfFkMtulcr6KVZdwNEOYugFIwmgcF9Ethbfce4ZXj2wcJsqfuCZPLrwlc2kXglNEpRWzTaXS+b1TztWMcseggQN0eGN+GX6p6LZVIgiQfk1f/ZEHQC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2.yahoo.com with HTTP; Fri, 19 Jun 2020 20:23:38 +0000 Received: by smtp409.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID f9cdc319e6c5c02f6098bff69147f340; Fri, 19 Jun 2020 20:23:36 +0000 (UTC) From: randall.s.becker@rogers.com To: git@vger.kernel.org Cc: "Randall S. Becker" , "Randall S . Becker" Subject: [Patch v2 2/2] strbuf: remove unreferenced strbuf_write_fd method. Date: Fri, 19 Jun 2020 16:23:20 -0400 Message-Id: <20200619202320.4619-3-randall.s.becker@rogers.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200619202320.4619-1-randall.s.becker@rogers.com> References: <20200619202320.4619-1-randall.s.becker@rogers.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: "Randall S. Becker" strbuf_write_fd was only used in bugreport.c. Since that file now uses write_in_full, this method is no longer needed. In addition, strbuf_write_fd did not guard against exceeding MAX_IO_SIZE for the platform, nor provided error handling in the event of a failure if only partial data was written to the file descriptor. Since already write_in_full has this capability and is in general use, it should be used instead. The change impacts strbuf.c and strbuf.h. Signed-off-by: Randall S. Becker --- strbuf.c | 5 ----- strbuf.h | 1 - 2 files changed, 6 deletions(-) diff --git a/strbuf.c b/strbuf.c index 2f1a7d3209..e3397cc4c7 100644 --- a/strbuf.c +++ b/strbuf.c @@ -556,11 +556,6 @@ ssize_t strbuf_write(struct strbuf *sb, FILE *f) return sb->len ? fwrite(sb->buf, 1, sb->len, f) : 0; } -ssize_t strbuf_write_fd(struct strbuf *sb, int fd) -{ - return sb->len ? write(fd, sb->buf, sb->len) : 0; -} - #define STRBUF_MAXLINK (2*PATH_MAX) int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint) diff --git a/strbuf.h b/strbuf.h index 7062eb6410..223ee2094a 100644 --- a/strbuf.h +++ b/strbuf.h @@ -473,7 +473,6 @@ int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint); * NUL bytes. */ ssize_t strbuf_write(struct strbuf *sb, FILE *stream); -ssize_t strbuf_write_fd(struct strbuf *sb, int fd); /** * Read a line from a FILE *, overwriting the existing contents of