mirror_zfs/lib/libzfs
Brian Behlendorf 14ee71efbc Use strerror() not strerror_r()
The differ() function used strerror_r() instead of strerror() because
it allowed the error message to be directly copied in to a buffer.
This causes two issues under Linux.

* There are two versions of strerror_r() available an XSI-compliant
  version which returns an 'int' error code.  And a GNU-specific
  version which return a 'char *' to the resulting error string.

    int strerror_r(int errnum, char *buf, size_t buflen);   /* XSI */
    char *strerror_r(int errnum, char *buf, size_t buflen); /* GNU */

* The most recent versions of strerror_r() are annotated with the
  warn_unused_result attribute.  This causes the following warning
  since the upstream implementation casts the result to void.

    warning: ignoring return value of 'strerror_r', declared with
    attribute warn_unused_result [-Wunused-result]

The cleanest way to resolve both of these problems is just to use
strerror() and make a copy of the result in to the buffer.  This
resolves both issues and this is the only instance of strerror_r()
in the code base.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1231
2013-01-28 10:02:38 -08:00
..
libzfs_changelist.c Recreate minors when renaming zvols 2012-11-19 16:59:44 -08:00
libzfs_config.c Illumos #2619 and #2747 2013-01-08 10:35:35 -08:00
libzfs_dataset.c Fix get/set users/groups in quota props via numeric id 2012-12-17 09:52:58 -08:00
libzfs_diff.c Use strerror() not strerror_r() 2013-01-28 10:02:38 -08:00
libzfs_fru.c Add linux topology support 2010-08-31 13:42:00 -07:00
libzfs_graph.c Fix gcc missing braces warnings 2010-08-27 15:34:03 -07:00
libzfs_import.c Illumos #3090 and #3102 2013-01-08 10:35:42 -08:00
libzfs_iter.c Illumos #1644, #1645, #1646, #1647, #1708 2012-07-31 09:25:30 -07:00
libzfs_mount.c Implemented sharing datasets via SMB using libshare 2012-12-03 09:42:15 -08:00
libzfs_pool.c Illumos #2619 and #2747 2013-01-08 10:35:35 -08:00
libzfs_sendrecv.c Illumos #2703: add mechanism to report ZFS send progress 2012-09-19 13:39:06 -07:00
libzfs_status.c Illumos #2762: zpool command should have better support for feature flags 2013-01-08 10:35:43 -08:00
libzfs_util.c Illumos #2619 and #2747 2013-01-08 10:35:35 -08:00
Makefile.am Illumos #1644, #1645, #1646, #1647, #1708 2012-07-31 09:25:30 -07:00