Signed-off-by: Karel Zak <kzak@redhat.com>
{
if (!cxt)
return NULL;
-
- return cxt->optlist ? : (cxt->optlist = mnt_new_optlist());
+ if (!cxt->optlist) {
+ cxt->optlist = mnt_new_optlist();
+ if (!cxt->optlist)
+ return NULL;
+ if (mnt_optlist_register_map(cxt->optlist,
+ mnt_get_builtin_optmap(MNT_LINUX_MAP)))
+ goto fail;
+ if (mnt_optlist_register_map(cxt->optlist,
+ mnt_get_builtin_optmap(MNT_USERSPACE_MAP)))
+ goto fail;
+ }
+
+ return cxt->optlist;
+fail:
+ mnt_unref_optlist(cxt->optlist);
+ return NULL;
}
/**