示例#1
0
static void CategoriesEditorCommand_init (CategoriesEditorCommand me, const char32 *name, Thing boss,
        Command_Callback execute, Command_Callback undo, int /*nCategories*/, int nSelected) {

	my nSelected = nSelected;
	Command_init (me, name, boss, execute, undo);
	my categories = Categories_create();
	my selection = NUMvector<long> (1, nSelected);
}
示例#2
0
static void
mountVserverInternal(struct Configuration const *cfg,
                     PathInfo const *path, bool use_chbind)
{
    if (!utilvserver_isFile(path->d,true)) return;

    pid_t		pid = Efork();
    if (pid==0) {
        Undo_detach();

        Echdir(cfg->vdir);

        if (use_chbind) {
            // TODO
        }

        struct Command	cmd;
        char const *	argv[] = {
            PROG_SECURE_MOUNT,
            "-a",
            "--chroot",
            "--fstab", path->d,
            0
        };

        Command_init(&cmd);
        Command_setParams(&cmd, argv);
        Command_exec(&cmd, false);
    }
    else {
        int		status;
        TEMP_FAILURE_RETRY(wait4(pid, &status, 0,0));

        if (!WIFEXITED(status) || WEXITSTATUS(status)!=0)
            exit(1);
    }
}