From nobody Mon Dec 30 22:20:15 2024 X-Original-To: dev-commits-src-all@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 4YMVsW40Knz5j5vH; Mon, 30 Dec 2024 22:20:15 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YMVsW3Nfkz4QsD; Mon, 30 Dec 2024 22:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735597215; 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=HqJwsr4A7Lr7n3Y4HLOGTmWP7wXIlTtck50RuUfAc48=; b=qlt5u+80Zm+f4i+x38ds/R8U9a076Fv9TFnHkp6av5sfsEVtke4iRwHAfL4KYgyFImeRHN WJ2OZpmTVU0e8h2ed+HOn64rUjAUYCfQ/MsquQZfeqFQkAMbUTcjRHE+YGPk9YbfwhQW7w UZe3BUMyIQF+ENWMr/cpGAs21gjvpLMu8gkXIK3Zs6iuIbyNM4gFagYDZQtvSD9Y+3oF7Y Zp8ucjNV2M94bAuFoRP+ClrTGQZUNFHUsyDedk0JNW8F7ykZVt5m6JE+NlYpQMjrO1oTEW I5kwTXjjzF2PMr2SnrZBRqtkBuymKuWBfgC1dQHFgNSpvgO8SXlur2QnHHbpEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735597215; 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=HqJwsr4A7Lr7n3Y4HLOGTmWP7wXIlTtck50RuUfAc48=; b=pd9uXEZIckiagB/gYM1f2j86IRV3qO9T5PSetDj2b1pNNdP6yplrhunWnvE6Uni6b1jqUD 8lCcZ8sPFLNGK6BMQJm3VTqGOgwsPoS/qJRXxPTeqpecK0ZtjdnchjYS3RJPhFzJ6/jocD fZB9a1soCcqlgMu7x6a3sw3+zIE0Esd2cV96AwWWIVdxNVF+w5lEeTZ8wXb1jOL0ocVjPE REIFA816zp7gw52s7BFjVFxFhSeZJ386eH3lJzPtswPv7nKopK2oRnEhzZPRw/6c8o2qL7 NFaE8nnD7bYPvh4Ir8QG2SFg7tHVHbigqzZp/7SZgP9iSYDMIEFbjWZUBvVutw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735597215; a=rsa-sha256; cv=none; b=HAaEN5lWqQ0kurio25k7QN5mjDj9hWrqMtImlWBEyyESGcfSfWuQXV49k2zr9uIb9gwDaj GEqdL/WbOy1rLOgyTyc+T6AueUuJ2xBH/bFuWCpwmPmbJvaS9yuTq8eGZasx9zX9RRpM7x wxmcEyYaLNeBzvnI+XBjX5N5j0Uhw8+/wiIjHXO8q42EwE9aYJMZFaBhekw4ZqU6X6zMg0 rj7WH0gday7ExXcZmw6EVH7VgNVTsNXM4u2OBdpw1W4cuWYpfccMlVqBgh7QmQGgzVBZuq uOHPn0hyjntYVhld4xfgSKbA5fExj9KTrQH2/7FsS2biIOQuMK+kqacXDOwioA== 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 4YMVsW2sjxz1C5p; Mon, 30 Dec 2024 22:20:15 +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 4BUMKF7K096511; Mon, 30 Dec 2024 22:20:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BUMKFCK096502; Mon, 30 Dec 2024 22:20:15 GMT (envelope-from git) Date: Mon, 30 Dec 2024 22:20:15 GMT Message-Id: <202412302220.4BUMKFCK096502@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: afb7a85e52c3 - stable/14 - makefs: Exit with error if writing cd image fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: afb7a85e52c323aca544f0d235b67123bf87d342 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=afb7a85e52c323aca544f0d235b67123bf87d342 commit afb7a85e52c323aca544f0d235b67123bf87d342 Author: Ed Maste AuthorDate: 2024-12-23 15:54:32 +0000 Commit: Ed Maste CommitDate: 2024-12-30 22:20:04 +0000 makefs: Exit with error if writing cd image fails Obtained from: OpenBSD c8f48d9b1ea9 Sponsored by: The FreeBSD Foundation (cherry picked from commit b45f84cc6213854ead00a4bfc7973332eda65676) --- 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 7ce9a3b6cbb2..bb3a86b7c8b5 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -465,7 +465,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; @@ -611,7 +611,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); @@ -623,7 +623,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 */