Пример #1
0
void mpClose()
{
	if (mpState) {
		mpCommand("quit");
		ShellWait(&mpx,1);
		ShellClean(&mpx);
	}
}
Пример #2
0
Файл: mpd.c Проект: avih/miniweb
void mpClose()
{
	mpPos = -1;
	if (mpState != MP_IDLE) {
		if (mpCommand("quit") > 0) ShellWait(&mpx,1000);
		ShellTerminate(&mpx);
		ShellClean(&mpx);
	}
}
Пример #3
0
int ShellRun(SHELL_PARAM* param, const char* cmdline)
{
    int ret;
    SHELL_PARAM* proc = param;
    if (!param) proc = calloc(1, sizeof(SHELL_PARAM));

    ret = ShellExec(proc, cmdline);
    if (ret == 0)
    {
        if (proc->flags & SF_READ_STDOUT_ALL)
            ShellRead(proc, -1);
        else
            ShellWait(proc, -1);
    }
    ShellClean(proc);

    if (!param)
    {
        free(proc);
    }
    return ret;
}