Skip to content

Commit a7aa1fa

Browse files
authored
Merge pull request #34 from johnramsden/zfs-2.0.0
Compatibility fixes for ZFS 2.0.0
2 parents 469a5e6 + f153192 commit a7aa1fa

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

include/libze/libze.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#ifndef ZECTL_LIBZE_H
22
#define ZECTL_LIBZE_H
33

4+
// Required for spl stat.h
5+
#define __USE_LARGEFILE64
6+
#define _LARGEFILE_SOURCE
7+
#define _LARGEFILE64_SOURCE
8+
49
#include "libzfs/libzfs.h"
510

611
#include <stddef.h>

lib/libze/libze.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -2643,15 +2643,20 @@ libze_rename(libze_handle *lzeh, char const boot_environment[static 1],
26432643
// Go ahead with rename, checks passed
26442644

26452645
// No recurse, no create parents
2646-
if (zfs_rename(be_zh, new_be_ds, B_FALSE, B_FALSE) != 0) {
2646+
renameflags_t rnf = {
2647+
.recursive = 0,
2648+
.nounmount = 1,
2649+
.forceunmount = 0,
2650+
};
2651+
if (zfs_rename(be_zh, new_be_ds, rnf) != 0) {
26472652
ret = libze_error_set(lzeh, LIBZE_ERROR_UNKNOWN,
26482653
"Rename of boot environment (%s) failed.\n", boot_environment);
26492654
goto err;
26502655
}
26512656

26522657
if (be_bpool_zh != NULL) {
26532658
// No recurse, no create parents
2654-
if (zfs_rename(be_bpool_zh, new_be_bpool_ds, B_FALSE, B_FALSE) != 0) {
2659+
if (zfs_rename(be_bpool_zh, new_be_bpool_ds, rnf) != 0) {
26552660
ret = libze_error_set(lzeh, LIBZE_ERROR_UNKNOWN,
26562661
"Rename of boot environment (%s) on bootpool failed.\n",
26572662
boot_environment);

0 commit comments

Comments
 (0)