};
struct Options opt = {
- .mtab = "/etc/mtab",
- .fstab = "/etc/fstab",
- .rootdir = 0,
- .ignore_mtab = false,
- .mount_all = false,
- .is_secure = false,
-
- .cur_rootdir_fd = open("/", O_RDONLY|O_DIRECTORY)
+ .mtab = "/etc/mtab",
+ .fstab = "/etc/fstab",
+ .rootdir = 0,
+ .ignore_mtab = false,
+ .mount_all = false,
+ .is_secure = false,
+ .cur_rootdir_fd = -1
};
+ opt.cur_rootdir_fd = open("/", O_RDONLY|O_DIRECTORY);
+
if (opt.cur_rootdir_fd==-1) {
perror("open(\"/\")");
return EXIT_FAILURE;