Fixed ZFS zpool freeze (debug command) not processing due to invalid ioctl call syntax.

MFC after:	1 week
This commit is contained in:
smh 2013-06-21 15:30:46 +00:00
parent c0ad5cbe7d
commit 08b5f9540c

View File

@ -5344,10 +5344,9 @@ main(int argc, char **argv)
* 'freeze' is a vile debugging abomination, so we treat
* it as such.
*/
char buf[16384];
int fd = open(ZFS_DEV, O_RDWR);
(void) strcpy((void *)buf, argv[2]);
return (!!ioctl(fd, ZFS_IOC_POOL_FREEZE, buf));
zfs_cmd_t zc = { 0 };
(void) strlcpy(zc.zc_name, argv[2], sizeof (zc.zc_name));
return (!!zfs_ioctl(g_zfs, ZFS_IOC_POOL_FREEZE, &zc));
} else {
(void) fprintf(stderr, gettext("unrecognized "
"command '%s'\n"), cmdname);