From nobody Mon Dec 23 16:05:05 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YH2ss64Dfz5WsFH; Mon, 23 Dec 2024 16:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YH2ss5LyRz4sk4; Mon, 23 Dec 2024 16:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734969905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z/sJrurirJUkx37J7vvl8jRGuHun5grsxeAgG/qLxuI=; b=m2aJ74AEWRqUCDdqQ67ScWkqQcbae8ktIsDRcD/2RU63eunGSLTuyla6dBgs8GbeC9a7ku Kh3qKeSeyXOuUjL8YktgZQN/QwuJgA83g4Uw6M8iwOXStI4I+2ZbnrtyDPrNFxg+ZfPNNn oFFS2RaPqQhHZHgLwxcWuuvbAYskXidbSjjWVfa3iL+3Fdg3KKysUHfzixqf/Rq+jWRlWY h5zxwgUSSLOb60GKqAJb2SaXYQJqvmfOOtdo+JZSXHANsYFW9tUHJDxxu0cNKLwobLmDxR bLXNvdzqfgdszfXFNX6N3H3vlffXUDlS6vsSaXiCg4Y0peoHvVDxH0xA339eeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734969905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z/sJrurirJUkx37J7vvl8jRGuHun5grsxeAgG/qLxuI=; b=sKLQGlVY2wlEF1RTkcfkxxvQB73gM0RattnNcJBSGcIwSSHngL304pTcRYJwUowEPYGISS ri5vZVLrw3ANlzLAMPbXjqLGOkp2W1mQ9N7ICFrOLdJtVzucFKIiUOMQOVHhwcnkYcSsxe 5xHjSP98wIwS5RRaE79jWTJWl+hf19l9XEJxxzWekYusFTcXV29ENSeDqHqiJh2aT001hM nsPX0rCyLt8jA6LHNVjDar2r2tjCAqMK+qzAwR5xnKEyqzz7hv7/F2vT/nZUyaUcFWM3Cv Mh1lQcyYRAFr++aqVI46TWTYwbiLwC0dIMgPcS8xvmzwnGtJIzFbXjpBpbT+0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734969905; a=rsa-sha256; cv=none; b=REbYPyA3qkvuiDirEMA47+7J37TsnUKn1kip5umlJHwWuPNLonf2aVX+9XxEOhTv28ymlx fTnRiA1tTkLA5OdVmLzFCG3nfZuj9+Jj+smrGMUcnteYj6tjiUkY6dxH2oQzU/MyDcj2ae Zvf9ta7FO+2jUYDBxVAPCuAoYNP8IqIlBek9qjXr6879eQWS79L1AEDHZ3WOYpu6uZZv2z xWzk9Eh2w/glPw5UHtjRGn8eyTNMm9WMX+lDMawpwdbCUi5JxCXkZoFqF97UkOTHZnjwJB QlPKZz12ZoigqZBKKI6nWl3QobLZ/Rg/Rq9sfUhrQIaoIlaly6qfTeMF22US1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YH2ss4yLHz10Ph; Mon, 23 Dec 2024 16:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BNG55nZ049052; Mon, 23 Dec 2024 16:05:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BNG55AH049049; Mon, 23 Dec 2024 16:05:05 GMT (envelope-from git) Date: Mon, 23 Dec 2024 16:05:05 GMT Message-Id: <202412231605.4BNG55AH049049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: b45f84cc6213 - main - makefs: Exit with error if writing cd image fails List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b45f84cc6213854ead00a4bfc7973332eda65676 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b45f84cc6213854ead00a4bfc7973332eda65676 commit b45f84cc6213854ead00a4bfc7973332eda65676 Author: Ed Maste AuthorDate: 2024-12-23 15:54:32 +0000 Commit: Ed Maste CommitDate: 2024-12-23 16:03:36 +0000 makefs: Exit with error if writing cd image fails Obtained from: OpenBSD c8f48d9b1ea9 Sponsored by: The FreeBSD Foundation --- usr.sbin/makefs/cd9660.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index 19bd6e0d21b0..d3baa3b78a6e 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -462,7 +462,7 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, fsinfo_t *fsopts) { int64_t startoffset; - int numDirectories; + int ret, numDirectories; uint64_t pathTableSectors; int64_t firstAvailableSector; int64_t totalSpace; @@ -604,7 +604,7 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, if (diskStructure->include_padding_areas) diskStructure->totalSectors += 150; - cd9660_write_image(diskStructure, image); + ret = cd9660_write_image(diskStructure, image); if (diskStructure->verbose_level > 1) { debug_print_volume_descriptor_information(diskStructure); @@ -616,7 +616,10 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, cd9660_free_structure(real_root); if (diskStructure->verbose_level > 0) - printf("%s: done\n", __func__); + printf("%s: done ret = %d\n", __func__, ret); + + if (ret == 0) /* cd9660_write_image() failed */ + exit(1); } /* Generic function pointer - implement later */