mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-01-14 01:02:04 +03:00
zvol_id: make array length properly known at compile time
Using strlen() in an static array declaration is a GCC extension. Clang calls it "gnu-folding-constant" and warns about it, which breaks the build. If it were widespread we could just turn off the warning, but since there's only one case, lets just change the array to an explicit size. Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #17954
This commit is contained in:
parent
aa091a17bd
commit
304810208e
@ -67,7 +67,7 @@ main(int argc, const char *const *argv)
|
||||
return (1);
|
||||
}
|
||||
|
||||
char zvol_name[MAXNAMELEN + strlen("-part") + 10];
|
||||
char zvol_name[MAXNAMELEN+15];
|
||||
if (ioctl(fd, BLKZNAME, zvol_name) == -1) {
|
||||
fprintf(stderr, "%s: BLKZNAME: %s\n",
|
||||
dev_name, strerror(errno));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user