freebsd-dev/lib
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
..
libavl Remove autotools products 2012-08-27 11:47:44 -07:00
libefi Remove autotools products 2012-08-27 11:47:44 -07:00
libnvpair Illumos #2619 and #2747 2013-01-08 10:35:35 -08:00
libshare Implemented sharing datasets via SMB using libshare 2012-12-03 09:42:15 -08:00
libspl Add txgs-<pool> kstat file 2012-11-02 15:45:56 -07:00
libunicode Remove autotools products 2012-08-27 11:47:44 -07:00
libuutil Remove autotools products 2012-08-27 11:47:44 -07:00
libzfs Use strerror() not strerror_r() 2013-01-28 10:02:38 -08:00
libzpool Illumos #1557 assertion failed in userland taskq_destroy() 2013-01-11 09:17:06 -08:00
Makefile.am Let libnvpair be linked independently of libzfs. 2012-02-07 11:37:15 -08:00