+ flags = flags ? flags : O_RDONLY | O_NONBLOCK;
+
+ fd = open(*path, flags, mode);
+
+ if (fd < 0) {
+ pb_log("%s: open failed '%s': (%d) %s\n", __func__, *path,
+ errno, strerror(errno));
+ talloc_free(*path);
+ *path = NULL;
+ return -1;
+ }
+
+ return fd;
+}
+
+int efi_del_variable(const struct efi_mount *efi_mount, const char *name)
+{
+ int fd, flag;
+ int rc = -1;
+ char *path;
+
+ assert(efi_mount);
+
+ fd = efi_open(efi_mount, name, 0, 0, &path);
+ if (fd < 0)
+ return -1;