From patchwork Mon Feb 26 22:05:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Randall S. Becker" X-Patchwork-Id: 13572971 Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73473131E23 for ; Mon, 26 Feb 2024 22:05:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708985154; cv=none; b=ue34S5WdQ00vsJU0Sroh6nI9Pio66umC3xyprlVdQ2EnToc24Tmr9LJY6czf4w66sbbakallk3B4dcm/AaLSgP2/RKfH6WihRK2N71FyDiTXveZtMDFegJ0JnjIy3bQ8/EBunxk+9FhQsuPib8cA7B/B5d5OKj6dboV5mr4O/ZM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708985154; c=relaxed/simple; bh=CQcMUA/sRB/QWbihFlxacVElu+NSy2DRwHBvVJHcNiE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bqp7gE1ki2HAGgiiIF9hhDy+nNXJs7ouk3Rs74o8owM00DzW5R2mimEp2wzkkZfSkE1mtGdS/R2PAMEFZC9nvB7djwqzIoFucxtIhfr0myKl30+pv0gO+fsxsLN9QJQsaooWVbxvF+pNJLF4D1t7fOZLKJ2fOwmupLlOllDONog= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LmTg/gUB; arc=none smtp.client-ip=209.85.160.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LmTg/gUB" Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-42e8e85a969so5302611cf.2 for ; Mon, 26 Feb 2024 14:05:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708985152; x=1709589952; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XOSgXZwzZutIsH9W50mGIJbV21EIOpTYplCjJ+NKEqw=; b=LmTg/gUBDJsTCzRWYnR3RU6UlxIM7NHbt8r+0EEqDXGxduirT9xrDWXOIbswcLYMC4 EvyCntoee6SaobQEbphZydGzCg7nmaHvbqJltBzFxwCe37619tyeS4OljEUr7g8Eb/9O /dgLzUwNkmdHSia/jSTQbnFtBZNqhnMpaqGN2NxHHSZgOaY1gPJX8vm26a/3ueSYRrix Bj3+GoeieOrWQDygl6cUZGWXCgda+zTzDKKYqKwQTyWRBxsOK17hEtnBTh8rZfA2BBI0 X4cKcV1NCxSAwNdKpg4YIwavFhb9i2vAaRvVxjIXrOrHOnr76ADOkkjt1HtfqYaj4OHi 9tvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708985152; x=1709589952; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XOSgXZwzZutIsH9W50mGIJbV21EIOpTYplCjJ+NKEqw=; b=ieFjACFsesw+anzIQGynxqWXCoXAJm8agsOGxayfXBbQNHDKjN3+3NTo88FJRw4LRP GfQyWCwMoTuolQGTNCCwAtrVdzMC7LaVF712IYnfzBFCakEKinXcrIKBsHTJ3Wt/kKL8 t5vRnBACtO48LA97jEso34m+5osJYWepuktnqq+8AszH8E6XQRXuI8Wgs/DxW04JcJLy 6BMAq7W7tyDPB+kc3Mo7HGTrJtXzR+vazFutuVnymP4W2ER1fWovP00Zt89MLbEJEYb+ +WEIYA6evsa98gXBE/gD4NEjPfloOCn6+1I/VDtp+p5aacFfL1NW7xBGCVv7dXdnp2ZH UrUw== X-Gm-Message-State: AOJu0Yw06C+21XIleCH4yfsfm7B/kua2h3RFLP/Eo3WpIVlkYI/S6v7v +2/yYfUU26zzrX1tPSaYdlCGUY6GPHfeAgqBGAyKZzxbtlk6nmWstNz0Kigs X-Google-Smtp-Source: AGHT+IHAi7RJyRz8WQi1b0fvF8qFH0cdGF5gtCgWixAubNwon4ByMmx93DDVIB6tAuXspTZZKjIgdw== X-Received: by 2002:ac8:5a95:0:b0:42e:7de0:cf28 with SMTP id c21-20020ac85a95000000b0042e7de0cf28mr5164546qtc.68.1708985152059; Mon, 26 Feb 2024 14:05:52 -0800 (PST) Received: from localhost.localdomain ([2607:fea8:3fa9:4200:ad2d:24a1:4eaf:e903]) by smtp.gmail.com with ESMTPSA id b6-20020ac87546000000b0042dce775a4bsm2911696qtr.3.2024.02.26.14.05.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 14:05:51 -0800 (PST) From: "Randall S. Becker" X-Google-Original-From: "Randall S. Becker" To: git@vger.kernel.org Cc: "Randall S. Becker" Subject: [PATCH v1 1/4] builtin/index-pack.c: change xwrite to write_in_full to allow large sizes. Date: Mon, 26 Feb 2024 17:05:35 -0500 Message-ID: <20240226220539.3494-2-randall.becker@nexbridge.ca> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20240226220539.3494-1-randall.becker@nexbridge.ca> References: <20240226220539.3494-1-randall.becker@nexbridge.ca> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Randall S. Becker" This change is required because some platforms do not support file writes of arbitrary sizes (e.g, NonStop). xwrite ends up truncating the output to the maximum single I/O size possible for the destination device. Signed-off-by: Randall S. Becker --- builtin/index-pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/index-pack.c b/builtin/index-pack.c index a3a37bd215..f80b8d101a 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -1571,7 +1571,7 @@ static void final(const char *final_pack_name, const char *curr_pack_name, * the last part of the input buffer to stdout. */ while (input_len) { - err = xwrite(1, input_buffer + input_offset, input_len); + err = write_in_full(1, input_buffer + input_offset, input_len); if (err <= 0) break; input_len -= err; From patchwork Mon Feb 26 22:05:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Randall S. Becker" X-Patchwork-Id: 13572972 Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32C9B131E31 for ; Mon, 26 Feb 2024 22:05:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708985155; cv=none; b=g1X/FEjn5lRomeXu0SwKAYpUBlEdNpXudRIKQySfricvjj0aptLiqUsDb+g6cQTf7OkzWddpRPCnLoMpg+BiY2mcE1cETCNKEyEYJyLmjsW9lFZRp1DF9cnTgslebkG9ITMFncMo9lUCO8vqbxKS+OJ9/s4batVTNJNNbTrBais= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708985155; c=relaxed/simple; bh=z20G1D/ingtEHs8n4ErdU8YD7D1M1aoKrhlupSXwVSo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LKVtriUIlO6jk4RzJL6S2XYIItfYtpxHj1HYbtFj67kbi5oyPtHLa9C+tMvr8uThGfoKf2N9CGNFqTJHN0hoz6tv6WIV+gS5hBzYQYVvah1F7hq3V07P3jNR9k1FPq+9fuI5ZQtv+salwI3YjjVJelCb89tlekcycVV8+C24ylI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Y4T45uzx; arc=none smtp.client-ip=209.85.210.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y4T45uzx" Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6e432514155so1786369a34.1 for ; Mon, 26 Feb 2024 14:05:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708985153; x=1709589953; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3565OIASkrgH1GqfUgs+5HfDtKha1mUbalh4b8nEKKo=; b=Y4T45uzxPYTWtgDu2cqzM7KKKmKQVvJvh0owB8KjJvJMGiTQ/qW6KfxK5kLbhmrWQO jVpLudA/DByqxT269jCo9BYbf4qTz5LaQ7yEKaYj4fSl/F/K4pinI0+q8L1tpJCw7bE5 yO3FB1T+U5ENtW9sKGU4s0xbL/V+M2zMyVnl5ua7GguMgdAUsEqefN0iqZ9pkbXtzMr/ D6vZScex38OkeLrF2nkM5Vn0pTC+CWuaeuIiYCGmc9DAkDV52Rxw4EgUW3Ywb3/6EZyj CY6NPNu2tPfTrCche5Xzk6bpSVcvig9qs6Ngy4wjKhDU2lB1F1hhqJbqUPq1QTyuNfDe KSXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708985153; x=1709589953; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3565OIASkrgH1GqfUgs+5HfDtKha1mUbalh4b8nEKKo=; b=w65frnPRXnAxPDadB19HeaymetGAQq7RQtLBrlv6ZUo453Vc6FRafz2RBORNSOLSpN za3br/gNkpQDTr431zQzWB++z7VKTUIw702lrGafxw3iJWBzNUxC166bSCMvmc0qzZpg BmcojZKCc9ylQUCC0cjkMmWL7aHXWWFcnruY9lMPVp5nuJedXetoZTsth62nGztYxSTk 1Br2tdL2CnsfhiR5O4jG2/CD3Y9WZW0BOuatmc64zEts5AL2JT4VeQrIgMvZuYh9ZxEU Wn7up7HBIPxvgnqevyN34GGyCydkYjHaHzWO29rnLGT0O8Pfccr5wuw/YPVikOJg3NKm AKEA== X-Gm-Message-State: AOJu0YzZtsHnR+AMLFNf7vuNWCILPQciEtwnjc00aEVC5xXFpTlsa6xg 5t9pO8NQMMqsx9aHaqiI5oGNzI6oeUIyUKUwT/2DXyW2KLQ882Pscj1y7jne X-Google-Smtp-Source: AGHT+IHqY7x5rMjf0FEyvi07LBf/hJj+ETe/j9DVFa3+vuSXIqsAz+lpa8GtJpzw7bocnYFAq9cJmg== X-Received: by 2002:a9d:7acb:0:b0:6e4:512e:e0ab with SMTP id m11-20020a9d7acb000000b006e4512ee0abmr9402912otn.6.1708985153117; Mon, 26 Feb 2024 14:05:53 -0800 (PST) Received: from localhost.localdomain ([2607:fea8:3fa9:4200:ad2d:24a1:4eaf:e903]) by smtp.gmail.com with ESMTPSA id b6-20020ac87546000000b0042dce775a4bsm2911696qtr.3.2024.02.26.14.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 14:05:52 -0800 (PST) From: "Randall S. Becker" X-Google-Original-From: "Randall S. Becker" To: git@vger.kernel.org Cc: "Randall S. Becker" Subject: [PATCH v1 2/4] builtin/receive-pack.c: change xwrite to write_in_full to allow large sizes. Date: Mon, 26 Feb 2024 17:05:36 -0500 Message-ID: <20240226220539.3494-3-randall.becker@nexbridge.ca> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20240226220539.3494-1-randall.becker@nexbridge.ca> References: <20240226220539.3494-1-randall.becker@nexbridge.ca> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Randall S. Becker" This change is required because some platforms do not support file writes of arbitrary sizes (e.g, NonStop). xwrite ends up truncating the output to the maximum single I/O size possible for the destination device. Signed-off-by: Randall S. Becker --- builtin/receive-pack.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index db65607485..5064f3d300 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -455,8 +455,9 @@ static void report_message(const char *prefix, const char *err, va_list params) if (use_sideband) send_sideband(1, 2, msg, sz, use_sideband); - else - xwrite(2, msg, sz); + else { + write_in_full(2, msg, sz); + } } __attribute__((format (printf, 1, 2))) From patchwork Mon Feb 26 22:05:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Randall S. Becker" X-Patchwork-Id: 13572973 Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D507C131E3B for ; Mon, 26 Feb 2024 22:05:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708985156; cv=none; b=X1a/nUc5EfaLXSaHLy2pmeDGZ2LiMwcGG36xMmnt45fPAckGdxGHyWLMXxm9fxiKDzKt2n1RtGPrGzeb4draK/6TuBMmA/qs/bob3xvAjdodoF1Fl5wS0tfHmHi6g+WcIuPYu+sSNl3qrpApUQstWZlyIbU0ulXnEgZJsTxQBL4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708985156; c=relaxed/simple; bh=ss8wEPQhUrwBOIq4BkUXzplHoevc/0jYFgkJtUVyNHY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aMfSQkpeopYxZOKAPC8SiqXwulwbI51qJDqouBy4VBy3cTNuL0etpAaHsP/kTcRmvT2D6UH5t9ox37KDy7KFH2TO2mZ0VIVtnpuhtq9vdz1Ucu9BSo4hBb/lXlIexIlJtWrOjmD78Mr86DUyyn/F90iaGlaHLHuaT0uenikyu70= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CQjbtKUf; arc=none smtp.client-ip=209.85.167.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CQjbtKUf" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-3bba50cd318so2677066b6e.0 for ; Mon, 26 Feb 2024 14:05:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708985154; x=1709589954; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lcBb9YUvq+p3EOGxZ9MY3/p4E7NvnPbgKnUHKwVO7NE=; b=CQjbtKUfrUr92ZQf6EljQZe0Yz7GWJKs7KtqwzcR/SGD0bQ8oCKyWlIN6rQJTeZ94G PQ5B6pD5+kUnwhP89nbBdHWRt6rLzYn7xFAWgoxoIEtG2GgllQ+YafngITnGed8WBymt WFRvHHi58vshUAtglWUVIlJjDCjl6SVntBcEwKQO9t8RyohCwE6fkK9Ywkni+QYf6AKS 2aoisCy9a0caG0Bo4nz5b1hvVWX/4v5q+bl+LIjkVp7DSXQKoKCCShTXhKVfM5MVqwMM 2m3dyrncy9Pgs3oKnC1pThl0zA9ERwAXX6aRdic7VMwc9S/tmjCdwLIZsC4cb/QV+aJB 4u1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708985154; x=1709589954; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lcBb9YUvq+p3EOGxZ9MY3/p4E7NvnPbgKnUHKwVO7NE=; b=qEeuFDDE2Xh2690WHPVxvssCwffAN4ZDQgZiAo/DE36FTRxmF84Tn8G7pWyXWhAgdD bl5BBHwixULYvY5XrI9aY3Nv5xK9fQTqGbvB0L0Pztj9mZZiC85zwfn7QURS62TqFBwQ f4W57ql3x+i5GeW4mrs3d8rG8fYVaVtTx7aZPXjT49SbS9HKJ303RoZvMCKullYCtWO3 PtwtjOmZSEK3V1nHl7FnmmaO5/JDdoRQWWuV9EJgwU7a78TyZpd1OPend+oOWjBbA1t0 1+fSN7kM37+6UMGvcDgwktZPV4C6tVkd21/UJUN+BtCFKoAMlmhBuArRbcBeWc0DoZ4E D6WA== X-Gm-Message-State: AOJu0YzQaTCDfahn846NGjS1JRGyf9WfFk3V8by0UJUeInS0+089FgZ0 KOOuRcqVxSnjgQU4OY0wL4+SgKb30HiIcGrZ5mpyvytYNJzUpjuq157hlz5e X-Google-Smtp-Source: AGHT+IHGhxJkb9uNfn1ccjsvVNQNwJJbXqZlbiUD3CEKZqp3Lu4monfkUrrjJAAMDVdQxYjzwaCVHQ== X-Received: by 2002:a05:6808:1893:b0:3bf:d840:6c0b with SMTP id bi19-20020a056808189300b003bfd8406c0bmr501094oib.36.1708985153903; Mon, 26 Feb 2024 14:05:53 -0800 (PST) Received: from localhost.localdomain ([2607:fea8:3fa9:4200:ad2d:24a1:4eaf:e903]) by smtp.gmail.com with ESMTPSA id b6-20020ac87546000000b0042dce775a4bsm2911696qtr.3.2024.02.26.14.05.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 14:05:53 -0800 (PST) From: "Randall S. Becker" X-Google-Original-From: "Randall S. Becker" To: git@vger.kernel.org Cc: "Randall S. Becker" Subject: [PATCH v1 3/4] builtin/repack.c: change xwrite to write_in_full to allow large sizes. Date: Mon, 26 Feb 2024 17:05:37 -0500 Message-ID: <20240226220539.3494-4-randall.becker@nexbridge.ca> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20240226220539.3494-1-randall.becker@nexbridge.ca> References: <20240226220539.3494-1-randall.becker@nexbridge.ca> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Randall S. Becker" This change is required because some platforms do not support file writes of arbitrary sizes (e.g, NonStop). xwrite ends up truncating the output to the maximum single I/O size possible for the destination device. The result of write_in_full() is also passed to the caller, which was previously ignored. Signed-off-by: Randall S. Becker --- builtin/repack.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/builtin/repack.c b/builtin/repack.c index ede36328a3..932d24c60b 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -307,6 +307,7 @@ static int write_oid(const struct object_id *oid, struct packed_git *pack UNUSED, uint32_t pos UNUSED, void *data) { + int err; struct child_process *cmd = data; if (cmd->in == -1) { @@ -314,8 +315,12 @@ static int write_oid(const struct object_id *oid, die(_("could not start pack-objects to repack promisor objects")); } - xwrite(cmd->in, oid_to_hex(oid), the_hash_algo->hexsz); - xwrite(cmd->in, "\n", 1); + err = write_in_full(cmd->in, oid_to_hex(oid), the_hash_algo->hexsz); + if (err <= 0) + return err; + err = write_in_full(cmd->in, "\n", 1); + if (err <= 0) + return err; return 0; } From patchwork Mon Feb 26 22:05:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Randall S. Becker" X-Patchwork-Id: 13572974 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21D1E131E5A for ; Mon, 26 Feb 2024 22:05:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708985157; cv=none; b=rahfihSSwG+4R0sumtEMmhjDKjpGFm6ajGqxlTzd85EdbIoGeOnwCKLkpG4bC88aMYT/0MM3yCmNFsm1pw5xWUkEzCQOtQiE3xrLEsSSuRwxVmHV2pBcCqSgNsyvijTd2q9R107qVHxxbgOuwDuUaCELIy27nJfMgLDoGfnxCc4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708985157; c=relaxed/simple; bh=F2DABo68YA6h+iO0327kr6Cdg8vWdEdwSfhGnoc54qk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VQdxi8/xd8L0y1T4OV7zmaZdNWKA6yN8ml218qNdi0exuZoTYk7CPEm6/nSb4L9EA2RVwRLT9itj5Zt3fmq1vmyN28kuCuuocIMUiyTbZsrB85Q6Tn2E07kBpzQnp7VSx1wf//QrprvXMdBfuQnPDRnt07IGcZwFLkN+NdWCMOk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=S2h1gpWJ; arc=none smtp.client-ip=209.85.160.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="S2h1gpWJ" Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-42e7ed64b5fso6461381cf.1 for ; Mon, 26 Feb 2024 14:05:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708985155; x=1709589955; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FlcuZrkEu3L2vyc03QFqijscR9qs1gNw5FIB7vTxre4=; b=S2h1gpWJWFxMPZYSyCZsd5KqfM6yxcFsdQ83f1mLoX56Db8fYkJYTUdMdKGwI+UEc6 qoiPHJAUo3a9VFPoryU+vfW/pdFaeSP8OYgBpiS1hWnQztE0/hPc8vqRM7feQBDztUuz lFhweddYe2hGZNtsAn8YfC1LfrN7G5S+ly25uNpqwYa/IxFevTH60ZEgorxvwv+rNscq zGsWpJAvKhFjycLOZgWoXVOy8UQCDrdocXVdFuEMALJtbi7eMyRWdyN3k+aW460SdYzU 2+Afdsvs+8VNAUXJsquVQs0wxpjpd+r3ig+ABBPXoW4cZ/rcLuofFpvEyoJCPkCULNS/ 4siw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708985155; x=1709589955; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FlcuZrkEu3L2vyc03QFqijscR9qs1gNw5FIB7vTxre4=; b=ZtEICvMihkf9ZXZd3wnz9RgZMwpJRgSLcLrPwlYi2RX9lK+FJ9+Wu3GphuuAKTCJLL REtloXj/MOUJ1D3sxB83N4qq2ymavKDiXSGCGxyHEiE8yC7esy4h9PFm2udFuHcE6on4 TlyQpUy92Cx5aopLyghzPXyLe2pdhMWm/gPwiMzSOJILlBRq+fhOWmVUbYIub0dpImlZ wM7/8VKoZeqRLvfg1YW1lJGFea2N72kNqAPfRntbfh+pc9igDb9rr7oNvbBDBSjhkjLg YYkQIrOoVHRKLLmuYJKxuzqOxgkfiNwgZNIQHvUFtWS3Q7dZw4qWD2lTXpRx3aZGHK4e lfSw== X-Gm-Message-State: AOJu0YwhMFiTD3lAnN2/w0I3A0RUojduid132v1lDg2X7ePN7SaXRmSb /bUcfJwFcNbrmAMfotJck/mpFy03Dk1JkOledSK6vhNSjG4+YbmOngxKApRJ X-Google-Smtp-Source: AGHT+IE5Vy8sFZFwNSBwVIBWdhgt3iFOPsogcTFMOGnJhp2mFg/JuETXITkctgdiZYcFvOktNbggCw== X-Received: by 2002:a05:622a:14c9:b0:42e:4340:735a with SMTP id u9-20020a05622a14c900b0042e4340735amr9482858qtx.64.1708985154828; Mon, 26 Feb 2024 14:05:54 -0800 (PST) Received: from localhost.localdomain ([2607:fea8:3fa9:4200:ad2d:24a1:4eaf:e903]) by smtp.gmail.com with ESMTPSA id b6-20020ac87546000000b0042dce775a4bsm2911696qtr.3.2024.02.26.14.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 14:05:54 -0800 (PST) From: "Randall S. Becker" X-Google-Original-From: "Randall S. Becker" To: git@vger.kernel.org Cc: "Randall S. Becker" Subject: [PATCH v1 4/4] builtin/unpack-objects.c: change xwrite to write_in_full to allow large sizes. Date: Mon, 26 Feb 2024 17:05:38 -0500 Message-ID: <20240226220539.3494-5-randall.becker@nexbridge.ca> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20240226220539.3494-1-randall.becker@nexbridge.ca> References: <20240226220539.3494-1-randall.becker@nexbridge.ca> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Randall S. Becker" This change is required because some platforms do not support file writes of arbitrary sizes (e.g, NonStop). xwrite ends up truncating the output to the maximum single I/O size possible for the destination device. Signed-off-by: Randall S. Becker --- builtin/unpack-objects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c index e0a701f2b3..6935c4574e 100644 --- a/builtin/unpack-objects.c +++ b/builtin/unpack-objects.c @@ -680,7 +680,7 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix UNUSED) /* Write the last part of the buffer to stdout */ while (len) { - int ret = xwrite(1, buffer + offset, len); + int ret = write_in_full(1, buffer + offset, len); if (ret <= 0) break; len -= ret;