Skip to content

Commit

Permalink
Use VERIFY() for asprintf due to rpm -D_FORTIFY_SOURCE=2
Browse files Browse the repository at this point in the history
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
  • Loading branch information
behlendorf committed Jul 1, 2010
1 parent 440c319 commit 3b54f50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/ztest/ztest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3b54f50

Please sign in to comment.