mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Fallback to strerror() when strerror_l() isn't available
Some C libraries, such as uClibc, do not provide strerror_l() in which case we fallback to strerror(). Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #16636 Closes #16640
This commit is contained in:
committed by
Tony Hutter
parent
a1ea40af86
commit
63fbbe8712
@@ -274,7 +274,11 @@ _LIBZUTIL_H void update_vdev_config_dev_sysfs_path(nvlist_t *nv,
|
||||
* Thread-safe strerror() for use in ZFS libraries
|
||||
*/
|
||||
static inline char *zfs_strerror(int errnum) {
|
||||
#ifdef HAVE_STRERROR_L
|
||||
return (strerror_l(errnum, uselocale(0)));
|
||||
#else
|
||||
return (strerror(errnum));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user