From 3b54f5030e07f5ae8898ee190da7390ad1ceb33c Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 1 Jul 2010 10:33:39 -0700 Subject: [PATCH] Use VERIFY() for asprintf due to rpm -D_FORTIFY_SOURCE=2 This check is part of ztest and a memory failure here is unlikely. However, if this does occur simply exiting is an perfectly valid way to handle the issue and it resulves the compiler warning. ztest.c:5522: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result --- cmd/ztest/ztest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index a57824155f..6a24795c43 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -5422,7 +5422,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