mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Correct compilation errors reported by GCC 10/11
New `zfs_type_t` value `ZFS_TYPE_INVALID` is introduced. Variable initialization is now possible to make GCC happy. Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: szubersk <szuberskidamian@gmail.com> Closes #12167 Closes #13103
This commit is contained in:
@@ -199,7 +199,7 @@ execvpe(const char *name, char * const argv[], char * const envp[])
|
||||
return (execvPe(name, path, argv, envp));
|
||||
}
|
||||
|
||||
#define ERRBUFLEN 256
|
||||
#define ERRBUFLEN 1024
|
||||
|
||||
static __thread char errbuf[ERRBUFLEN];
|
||||
|
||||
@@ -207,10 +207,10 @@ const char *
|
||||
libzfs_error_init(int error)
|
||||
{
|
||||
char *msg = errbuf;
|
||||
size_t len, msglen = ERRBUFLEN;
|
||||
size_t msglen = sizeof (errbuf);
|
||||
|
||||
if (modfind("zfs") < 0) {
|
||||
len = snprintf(msg, msglen, dgettext(TEXT_DOMAIN,
|
||||
size_t len = snprintf(msg, msglen, dgettext(TEXT_DOMAIN,
|
||||
"Failed to load %s module: "), ZFS_KMOD);
|
||||
msg += len;
|
||||
msglen -= len;
|
||||
@@ -285,7 +285,6 @@ zfs_jail(zfs_handle_t *zhp, int jailid, int attach)
|
||||
{
|
||||
libzfs_handle_t *hdl = zhp->zfs_hdl;
|
||||
zfs_cmd_t zc = {"\0"};
|
||||
char errbuf[1024];
|
||||
unsigned long cmd;
|
||||
int ret;
|
||||
|
||||
@@ -314,6 +313,10 @@ zfs_jail(zfs_handle_t *zhp, int jailid, int attach)
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"vdevs can not be jailed"));
|
||||
return (zfs_error(hdl, EZFS_BADTYPE, errbuf));
|
||||
case ZFS_TYPE_INVALID:
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"invalid zfs_type_t: ZFS_TYPE_INVALID"));
|
||||
return (zfs_error(hdl, EZFS_BADTYPE, errbuf));
|
||||
case ZFS_TYPE_POOL:
|
||||
case ZFS_TYPE_FILESYSTEM:
|
||||
/* OK */
|
||||
|
||||
Reference in New Issue
Block a user