summaryrefslogtreecommitdiffstats
path: root/cmd/ztest/ztest.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-08-26 09:52:40 -0700
committerBrian Behlendorf <[email protected]>2010-08-27 15:34:02 -0700
commit0e5b68e0159e071dae2cac01c2b6783b8e926133 (patch)
tree831cd00c0a79b73297f7d6b051ce47a02e523fd5 /cmd/ztest/ztest.c
parentf709a82dc11fe9bad4953e9cfb0a78f71c859ff0 (diff)
Fix gcc fortify source warnings
Resolve issues uncovered by -D_FORTIFY_SOURCE=2, the default redhat macro's file adds this option to the cflags. This causes warnings of the following type designed to keep the developer honest: warning: ignoring return value of 'foo', declared with attribute warn_unused_result The short term fix is to wrap these calls in VERIFY() to check the return code. The code was already assusing these would never fail. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'cmd/ztest/ztest.c')
-rw-r--r--cmd/ztest/ztest.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index 771f1427e..5e21e620d 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -2592,7 +2592,7 @@ grow_vdev(vdev_t *vd, void *arg)
return (vd);
fsize = lseek(fd, 0, SEEK_END);
- (void) ftruncate(fd, *newsize);
+ VERIFY(ftruncate(fd, *newsize) == 0);
if (zopt_verbose >= 6) {
(void) printf("%s grew from %lu to %lu bytes\n",
@@ -5459,7 +5459,8 @@ main(int argc, char **argv)
process_options(argc, argv);
/* Override location of zpool.cache */
- (void) asprintf((char **)&spa_config_path, "%s/zpool.cache", zopt_dir);
+ VERIFY(asprintf((char **)&spa_config_path, "%s/zpool.cache",
+ zopt_dir) != -1);
/*
* Blow away any existing copy of zpool.cache