git: f81286d19230 - stable/13 - makefs: Exit with error if writing cd image fails
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 15 Jan 2025 02:35:39 UTC
The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f81286d192304bba45697ec157c73a8e44ff57eb commit f81286d192304bba45697ec157c73a8e44ff57eb Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2024-12-23 15:54:32 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2025-01-15 02:35:28 +0000 makefs: Exit with error if writing cd image fails Obtained from: OpenBSD c8f48d9b1ea9 Sponsored by: The FreeBSD Foundation (cherry picked from commit b45f84cc6213854ead00a4bfc7973332eda65676) (cherry picked from commit afb7a85e52c323aca544f0d235b67123bf87d342) --- 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 654285057378..17fab3a8cfdf 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -467,7 +467,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; @@ -613,7 +613,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); @@ -625,7 +625,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 */