mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 10:01:01 +03:00
14ee71efbc
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 |
||
---|---|---|
.. | ||
libzfs_changelist.c | ||
libzfs_config.c | ||
libzfs_dataset.c | ||
libzfs_diff.c | ||
libzfs_fru.c | ||
libzfs_graph.c | ||
libzfs_import.c | ||
libzfs_iter.c | ||
libzfs_mount.c | ||
libzfs_pool.c | ||
libzfs_sendrecv.c | ||
libzfs_status.c | ||
libzfs_util.c | ||
Makefile.am |