if (!upd)
return NULL;
- DBG(MTAB, mnt_debug_h(upd, "allocate"));
+ DBG(UPDATE, mnt_debug_h(upd, "allocate"));
if (action)
mnt_update_set_action(upd, action);
if (!upd)
return;
- DBG(MTAB, mnt_debug_h(upd, "free"));
+ DBG(UPDATE, mnt_debug_h(upd, "free"));
mnt_free_lock(upd->lc);
free(upd->filename);
if (!tb)
goto error;
- DBG(MTAB, mnt_debug("%s: update from tab %p", filename, tb));
+ DBG(UPDATE, mnt_debug("%s: update from tab %p", filename, tb));
if (snprintf(tmpname, sizeof(tmpname), "%s.tmp", filename)
>= sizeof(tmpname))
return 0;
error:
- DBG(MTAB, mnt_debug("%s: update from tab %p failed", filename, tb));
+ DBG(UPDATE, mnt_debug("%s: update from tab %p failed", filename, tb));
if (f)
fclose(f);
return -1;
if (!upd || !upd->fs)
return -1;
- DBG(MTAB, mnt_debug_h(upd,
+ DBG(UPDATE, mnt_debug_h(upd,
"prepare update (target %s, source %s, optstr %s)",
mnt_fs_get_target(upd->fs),
mnt_fs_get_source(upd->fs),
/* TODO: cannonicalize source and target paths on mnt->fs */
if (upd->format != MNT_FMT_FSTAB) {
+ unsigned long fl = 0;
+
o = mnt_fs_get_optstr(upd->fs);
- if (o)
- mnt_optstr_get_mountflags(o, &upd->mountflags);
+ if (o && !mnt_optstr_get_mountflags(o, &fl))
+ upd->mountflags |= fl;
}
/* umount */
goto err;
}
- DBG(MTAB, mnt_debug_h(upd, "prepare update: success"));
+ DBG(UPDATE, mnt_debug_h(upd, "prepare update: success"));
free(u);
return 0;
err:
- DBG(MTAB, mnt_debug_h(upd, "prepare update: failed"));
+ DBG(UPDATE, mnt_debug_h(upd, "prepare update: failed"));
free(u);
return -1;
nothing:
- DBG(MTAB, mnt_debug_h(upd, "prepare update: unnecessary"));
+ DBG(UPDATE, mnt_debug_h(upd, "prepare update: unnecessary"));
free(u);
return 1;
}
assert(upd);
- DBG(MTAB, mnt_debug_h(upd, "add entry"));
+ DBG(UPDATE, mnt_debug_h(upd, "add entry"));
if (upd->lc)
mnt_lock_file(upd->lc);
target = mnt_fs_get_target(upd->fs);
assert(target);
- DBG(MTAB, mnt_debug_h(upd, "remove entry (target %s)", target));
+ DBG(UPDATE, mnt_debug_h(upd, "remove entry (target %s)", target));
if (upd->lc)
mnt_lock_file(upd->lc);
if (!upd->old_target)
return -1;
- DBG(MTAB, mnt_debug_h(upd, "modify target (%s->%s)",
+ DBG(UPDATE, mnt_debug_h(upd, "modify target (%s->%s)",
upd->old_target, mnt_fs_get_target(upd->fs)));
if (upd->lc)
assert(target);
assert(upd->filename);
- DBG(MTAB, mnt_debug_h(upd, "modify options (target %s)", target));
+ DBG(UPDATE, mnt_debug_h(upd, "modify options (target %s)", target));
if (upd->lc)
mnt_lock_file(upd->lc);
if (!upd || !upd->fs)
return -1;
- DBG(MTAB, mnt_debug_h(upd, "update (target %s)",
+ DBG(UPDATE, mnt_debug_h(upd, "update (target %s)",
mnt_fs_get_target(upd->fs)));
/*
* umount