while((rc = waitpid(command_pid, &w, 0) < 0 && errno == EINTR))
;
if(rc < 0)
- fatal(errno, "waitpid");
+ disorder_fatal(errno, "waitpid");
if(w) {
ws = wstat(w);
- error(0, "command subprocess %s", ws);
+ disorder_error(0, "command subprocess %s", ws);
xfree(ws);
}
}
const char *command;
if(!(command = uaudio_get("command", NULL)))
- fatal(0, "'command' not set");
+ disorder_fatal(0, "'command' not set");
xpipe(pfd);
command_pid = xfork();
if(!command_pid) {
* format. The original intended model is that you adapt DisOrder to the
* command you run but it'd be nice to support the opposite. */
execl("/bin/sh", "sh", "-c", command, (char *)0);
- fatal(errno, "error executing /bin/sh");
+ disorder_fatal(errno, "error executing /bin/sh");
}
close(pfd[0]);
command_fd = pfd[1];
case EINTR:
return 0; /* will retry */
case EPIPE:
- error(0, "audio command subprocess terminated");
+ disorder_error(0, "audio command subprocess terminated");
command_wait();
command_open();
return 0; /* will retry */
default:
- fatal(errno, "error writing to audio command subprocess");
+ disorder_fatal(errno, "error writing to audio command subprocess");
}
}
/* TODO what if we write a partial sample? Actually reasonably unlikely but
}
static void command_start(uaudio_callback *callback,
- void *userdata) {
+ void *userdata) {
const char *pausemode = uaudio_get("pause-mode", "silence");
unsigned flags = 0;
else if(!strcmp(pausemode, "suspend"))
command_suspend_on_pause = 1;
else
- fatal(0, "unknown pause mode '%s'", pausemode);
+ disorder_fatal(0, "unknown pause mode '%s'", pausemode);
command_open();
uaudio_schedule_init();
uaudio_thread_start(callback,
.activate = uaudio_thread_activate,
.deactivate = uaudio_thread_deactivate,
.configure = command_configure,
+ .flags = UAUDIO_API_CLIENT | UAUDIO_API_SERVER,
};
/*