summaryrefslogtreecommitdiffstats
path: root/usr.sbin/makefs
diff options
context:
space:
mode:
authornatano <natano@openbsd.org>2016-10-26 15:31:13 +0000
committernatano <natano@openbsd.org>2016-10-26 15:31:13 +0000
commit944eabd52d764ded8b3640d0e9d9f361aa2aa591 (patch)
tree9a3e0200a0db2aca98951aad6c2803896fa715cc /usr.sbin/makefs
parentmac68k is discontinued (diff)
downloadwireguard-openbsd-944eabd52d764ded8b3640d0e9d9f361aa2aa591.tar.xz
wireguard-openbsd-944eabd52d764ded8b3640d0e9d9f361aa2aa591.zip
s/EXIT_FAILURE/1/
Diffstat (limited to 'usr.sbin/makefs')
-rw-r--r--usr.sbin/makefs/cd9660.c14
-rw-r--r--usr.sbin/makefs/cd9660.h4
-rw-r--r--usr.sbin/makefs/cd9660/cd9660_eltorito.c7
-rw-r--r--usr.sbin/makefs/cd9660/cd9660_write.c8
-rw-r--r--usr.sbin/makefs/ffs.c8
-rw-r--r--usr.sbin/makefs/ffs/buf.c8
-rw-r--r--usr.sbin/makefs/ffs/ffs_alloc.c9
-rw-r--r--usr.sbin/makefs/ffs/mkfs.c18
8 files changed, 36 insertions, 40 deletions
diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c
index d54edad8525..f37dff6e863 100644
--- a/usr.sbin/makefs/cd9660.c
+++ b/usr.sbin/makefs/cd9660.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660.c,v 1.16 2016/10/26 14:14:16 natano Exp $ */
+/* $OpenBSD: cd9660.c,v 1.17 2016/10/26 15:31:13 natano Exp $ */
/* $NetBSD: cd9660.c,v 1.52 2015/12/24 15:52:37 christos Exp $ */
/*
@@ -411,7 +411,7 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root,
if (diskStructure->isoLevel < 2 &&
diskStructure->allow_multidot)
- errx(EXIT_FAILURE, "allow-multidot requires iso level of 2");
+ errx(1, "allow-multidot requires iso level of 2");
assert(image != NULL);
assert(dir != NULL);
@@ -440,10 +440,10 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root,
&numDirectories, &error);
if (TAILQ_EMPTY(&real_root->cn_children)) {
- errx(EXIT_FAILURE, "%s: converted directory is empty. "
+ errx(1, "%s: converted directory is empty. "
"Tree conversion failed", __func__);
} else if (error != 0) {
- errx(EXIT_FAILURE, "%s: tree conversion failed", __func__);
+ errx(1, "%s: tree conversion failed", __func__);
}
/* Add the dot and dot dot records */
@@ -469,7 +469,7 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root,
firstAvailableSector = cd9660_setup_boot(diskStructure,
firstAvailableSector);
if (firstAvailableSector < 0)
- errx(EXIT_FAILURE, "setup_boot failed");
+ errx(1, "setup_boot failed");
}
/* LE first, then BE */
diskStructure->primaryLittleEndianTableSector = firstAvailableSector;
@@ -1462,7 +1462,7 @@ cd9660_compute_full_filename(cd9660node *node, char *buf)
len = snprintf(buf, len, "%s/%s/%s", node->node->root,
node->node->path, node->node->name);
if (len > CD9660MAXPATH)
- errx(EXIT_FAILURE, "Pathname too long.");
+ errx(1, "Pathname too long.");
}
/*
@@ -1966,7 +1966,7 @@ cd9660_add_generic_bootimage(iso9660_disk *diskStructure, const char *bootimage)
/* Get information about the file */
if (lstat(diskStructure->generic_bootimage, &stbuf) == -1)
- err(EXIT_FAILURE, "%s: lstat(\"%s\")", __func__,
+ err(1, "%s: lstat(\"%s\")", __func__,
diskStructure->generic_bootimage);
if (stbuf.st_size > 32768) {
diff --git a/usr.sbin/makefs/cd9660.h b/usr.sbin/makefs/cd9660.h
index 9466348700d..96d12bf4268 100644
--- a/usr.sbin/makefs/cd9660.h
+++ b/usr.sbin/makefs/cd9660.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660.h,v 1.10 2016/10/26 14:14:16 natano Exp $ */
+/* $OpenBSD: cd9660.h,v 1.11 2016/10/26 15:31:13 natano Exp $ */
/* $NetBSD: cd9660.h,v 1.21 2015/12/24 15:52:37 christos Exp $ */
/*
@@ -116,7 +116,7 @@ typedef struct {
howmany((__bytes), (__sector_size))
#define CD9660_MEM_ALLOC_ERROR(_F) \
- err(EXIT_FAILURE, "%s, %s l. %d", _F, __FILE__, __LINE__)
+ err(1, "%s, %s l. %d", _F, __FILE__, __LINE__)
#define CD9660_TYPE_FILE 0x01
#define CD9660_TYPE_DIR 0x02
diff --git a/usr.sbin/makefs/cd9660/cd9660_eltorito.c b/usr.sbin/makefs/cd9660/cd9660_eltorito.c
index baa00773d56..60cc8abbcbd 100644
--- a/usr.sbin/makefs/cd9660/cd9660_eltorito.c
+++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_eltorito.c,v 1.7 2016/10/26 15:22:40 natano Exp $ */
+/* $OpenBSD: cd9660_eltorito.c,v 1.8 2016/10/26 15:31:13 natano Exp $ */
/* $NetBSD: cd9660_eltorito.c,v 1.20 2013/01/28 21:03:28 christos Exp $ */
/*
@@ -119,8 +119,7 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, const char *boot_info)
/* Get information about the file */
if (lstat(new_image->filename, &stbuf) == -1)
- err(EXIT_FAILURE, "%s: lstat(\"%s\")", __func__,
- new_image->filename);
+ err(1, "%s: lstat(\"%s\")", __func__, new_image->filename);
switch (stbuf.st_size) {
case 1440 * 1024:
@@ -185,7 +184,7 @@ cd9660_eltorito_add_boot_option(iso9660_disk *diskStructure,
break;
}
if (image == NULL)
- errx(EXIT_FAILURE, "Attempted to add boot option, "
+ errx(1, "Attempted to add boot option, "
"but no boot images have been specified");
if (strcmp(option_string, "no-emul-boot") == 0) {
diff --git a/usr.sbin/makefs/cd9660/cd9660_write.c b/usr.sbin/makefs/cd9660/cd9660_write.c
index b706d4283a6..ee45798cc98 100644
--- a/usr.sbin/makefs/cd9660/cd9660_write.c
+++ b/usr.sbin/makefs/cd9660/cd9660_write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_write.c,v 1.5 2016/10/23 11:09:38 natano Exp $ */
+/* $OpenBSD: cd9660_write.c,v 1.6 2016/10/26 15:31:13 natano Exp $ */
/* $NetBSD: cd9660_write.c,v 1.17 2013/10/19 17:16:37 christos Exp $ */
/*
@@ -60,10 +60,8 @@ cd9660_write_image(iso9660_disk *diskStructure, const char* image)
int status;
char buf[CD9660_SECTOR_SIZE];
- if ((fd = fopen(image, "w+")) == NULL) {
- err(EXIT_FAILURE, "%s: Can't open `%s' for writing", __func__,
- image);
- }
+ if ((fd = fopen(image, "w+")) == NULL)
+ err(1, "%s: Can't open `%s' for writing", __func__, image);
if (diskStructure->has_generic_bootimage) {
status = cd9660_copy_file(diskStructure, fd, 0,
diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c
index c6eedbc9cb5..338ac402652 100644
--- a/usr.sbin/makefs/ffs.c
+++ b/usr.sbin/makefs/ffs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs.c,v 1.18 2016/10/26 07:53:47 natano Exp $ */
+/* $OpenBSD: ffs.c,v 1.19 2016/10/26 15:31:13 natano Exp $ */
/* $NetBSD: ffs.c,v 1.66 2015/12/21 00:58:08 christos Exp $ */
/*
@@ -714,10 +714,10 @@ ffs_write_file(union dinode *din, uint32_t ino, void *buf, fsinfo_t *fsopts)
if (!isfile)
;
else if ((nread = read(ffd, fbuf, chunk)) == -1)
- err(EXIT_FAILURE, "Reading `%s', %lld bytes to go",
- (char *)buf, (long long)bufleft);
+ err(1, "Reading `%s', %lld bytes to go", (char *)buf,
+ (long long)bufleft);
else if (nread != chunk)
- errx(EXIT_FAILURE, "Reading `%s', %lld bytes to go, "
+ errx(1, "Reading `%s', %lld bytes to go, "
"read %zd bytes, expected %ju bytes, does "
"metalog size= attribute mismatch source size?",
(char *)buf, (long long)bufleft, nread,
diff --git a/usr.sbin/makefs/ffs/buf.c b/usr.sbin/makefs/ffs/buf.c
index 8f0a224cfbe..c6ee039d38c 100644
--- a/usr.sbin/makefs/ffs/buf.c
+++ b/usr.sbin/makefs/ffs/buf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buf.c,v 1.4 2016/10/22 18:17:14 natano Exp $ */
+/* $OpenBSD: buf.c,v 1.5 2016/10/26 15:31:13 natano Exp $ */
/* $NetBSD: buf.c,v 1.24 2016/06/24 19:24:11 christos Exp $ */
/*
@@ -64,14 +64,14 @@ bread(struct mkfsvnode *vp, daddr_t blkno, int size, int u2 __unused,
*bpp = getblk(vp, blkno, size, 0, 0);
offset = (*bpp)->b_blkno * fs->sectorsize + fs->offset;
if (lseek((*bpp)->b_fs->fd, offset, SEEK_SET) == -1)
- err(EXIT_FAILURE, "%s: lseek %lld (%lld)", __func__,
+ err(1, "%s: lseek %lld (%lld)", __func__,
(long long)(*bpp)->b_blkno, (long long)offset);
rv = read((*bpp)->b_fs->fd, (*bpp)->b_data, (size_t)(*bpp)->b_bcount);
if (rv == -1) /* read error */
- err(EXIT_FAILURE, "%s: read %ld (%lld) returned %zd", __func__,
+ err(1, "%s: read %ld (%lld) returned %zd", __func__,
(*bpp)->b_bcount, (long long)offset, rv);
else if (rv != (*bpp)->b_bcount) /* short read */
- errx(EXIT_FAILURE, "%s: read %ld (%lld) returned %zd", __func__,
+ errx(1, "%s: read %ld (%lld) returned %zd", __func__,
(*bpp)->b_bcount, (long long)offset, rv);
else
return (0);
diff --git a/usr.sbin/makefs/ffs/ffs_alloc.c b/usr.sbin/makefs/ffs/ffs_alloc.c
index 582a892d19a..195b618b275 100644
--- a/usr.sbin/makefs/ffs/ffs_alloc.c
+++ b/usr.sbin/makefs/ffs/ffs_alloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_alloc.c,v 1.11 2016/10/22 19:43:50 natano Exp $ */
+/* $OpenBSD: ffs_alloc.c,v 1.12 2016/10/26 15:31:13 natano Exp $ */
/* $NetBSD: ffs_alloc.c,v 1.29 2016/06/24 19:24:11 christos Exp $ */
/* From: NetBSD: ffs_alloc.c,v 1.50 2001/09/06 02:16:01 lukem Exp */
@@ -91,7 +91,7 @@ ffs_alloc(struct inode *ip, daddr_t lbn __unused, daddr_t bpref, int size,
*bnp = 0;
if (size > fs->fs_bsize || fragoff(fs, size) != 0) {
- errx(EXIT_FAILURE, "%s: bad size: bsize %d size %d", __func__,
+ errx(1, "%s: bad size: bsize %d size %d", __func__,
fs->fs_bsize, size);
}
if (size == fs->fs_bsize && fs->fs_cstotal.cs_nbfree == 0)
@@ -449,7 +449,7 @@ ffs_mapsearch(struct fs *fs, struct cg *cgp, daddr_t bpref, int allocsiz)
(const u_char *)fragtbl[fs->fs_frag],
(1 << (allocsiz - 1 + (fs->fs_frag % NBBY))));
if (loc == 0) {
- errx(EXIT_FAILURE, "%s: map corrupted: start %d "
+ errx(1, "%s: map corrupted: start %d "
"len %d offset %d %ld", __func__, ostart, olen,
cgp->cg_freeoff,
(long)cg_blksfree(cgp) - (long)cgp);
@@ -473,7 +473,6 @@ ffs_mapsearch(struct fs *fs, struct cg *cgp, daddr_t bpref, int allocsiz)
subfield <<= 1;
}
}
- errx(EXIT_FAILURE, "%s: block not in map: bno %lld", __func__,
- (long long)bno);
+ errx(1, "%s: block not in map: bno %lld", __func__, (long long)bno);
return (-1);
}
diff --git a/usr.sbin/makefs/ffs/mkfs.c b/usr.sbin/makefs/ffs/mkfs.c
index e62a57d88ef..badebc654e6 100644
--- a/usr.sbin/makefs/ffs/mkfs.c
+++ b/usr.sbin/makefs/ffs/mkfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkfs.c,v 1.11 2016/10/22 19:43:50 natano Exp $ */
+/* $OpenBSD: mkfs.c,v 1.12 2016/10/26 15:31:13 natano Exp $ */
/* $NetBSD: mkfs.c,v 1.34 2016/06/24 19:24:11 christos Exp $ */
/*
@@ -752,15 +752,15 @@ ffs_rdfs(daddr_t bno, int size, void *bf, const fsinfo_t *fsopts)
offset = bno * fsopts->sectorsize + fsopts->offset;
if (lseek(fsopts->fd, offset, SEEK_SET) < 0)
- err(EXIT_FAILURE, "%s: seek error for sector %lld", __func__,
+ err(1, "%s: seek error for sector %lld", __func__,
(long long)bno);
n = read(fsopts->fd, bf, size);
if (n == -1) {
- err(EXIT_FAILURE, "%s: read error bno %lld size %d", __func__,
+ err(1, "%s: read error bno %lld size %d", __func__,
(long long)bno, size);
}
else if (n != size)
- errx(EXIT_FAILURE, "%s: short read error for sector %lld", __func__,
+ errx(1, "%s: short read error for sector %lld", __func__,
(long long)bno);
}
@@ -775,15 +775,15 @@ ffs_wtfs(daddr_t bno, int size, void *bf, const fsinfo_t *fsopts)
offset = bno * fsopts->sectorsize + fsopts->offset;
if (lseek(fsopts->fd, offset, SEEK_SET) == -1)
- err(EXIT_FAILURE, "%s: seek error for sector %lld", __func__,
+ err(1, "%s: seek error for sector %lld", __func__,
(long long)bno);
n = write(fsopts->fd, bf, size);
if (n == -1)
- err(EXIT_FAILURE, "%s: write error for sector %lld", __func__,
+ err(1, "%s: write error for sector %lld", __func__,
(long long)bno);
else if (n != size)
- errx(EXIT_FAILURE, "%s: short write error for sector %lld",
- __func__, (long long)bno);
+ errx(1, "%s: short write error for sector %lld", __func__,
+ (long long)bno);
}
@@ -806,5 +806,5 @@ ilog2(int val)
for (n = 0; n < sizeof(n) * CHAR_BIT; n++)
if (1 << n == val)
return (n);
- errx(EXIT_FAILURE, "%s: %d is not a power of 2", __func__, val);
+ errx(1, "%s: %d is not a power of 2", __func__, val);
}