chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
disobedience notices rescans
[disorder]
/
server
/
speaker-command.c
diff --git
a/server/speaker-command.c
b/server/speaker-command.c
index 8a8f63cbbf21ad3e16b440d1f80ddcd80a939be5..088d0cd77b5faf57112aafecef8627491a2b19db 100644
(file)
--- a/
server/speaker-command.c
+++ b/
server/speaker-command.c
@@
-25,6
+25,7
@@
#include <unistd.h>
#include <poll.h>
#include <unistd.h>
#include <poll.h>
+#include <errno.h>
#include "configuration.h"
#include "syscalls.h"
#include "configuration.h"
#include "syscalls.h"
@@
-52,6
+53,7
@@
static void fork_cmd(void) {
xpipe(pfd);
cmdpid = xfork();
if(!cmdpid) {
xpipe(pfd);
cmdpid = xfork();
if(!cmdpid) {
+ exitfn = _exit;
signal(SIGPIPE, SIG_DFL);
xdup2(pfd[0], 0);
close(pfd[0]);
signal(SIGPIPE, SIG_DFL);
xdup2(pfd[0], 0);
close(pfd[0]);
@@
-72,7
+74,7
@@
static void command_init(void) {
/** @brief Play to a subprocess */
static size_t command_play(size_t frames) {
/** @brief Play to a subprocess */
static size_t command_play(size_t frames) {
- size_t bytes = frames *
device_
bpf;
+ size_t bytes = frames * bpf;
int written_bytes;
written_bytes = write(cmdfd, playing->buffer + playing->start, bytes);
int written_bytes;
written_bytes = write(cmdfd, playing->buffer + playing->start, bytes);
@@
-90,7
+92,7
@@
static size_t command_play(size_t frames) {
fatal(errno, "error writing to subprocess");
}
} else
fatal(errno, "error writing to subprocess");
}
} else
- return written_bytes /
device_
bpf;
+ return written_bytes / bpf;
}
/** @brief Update poll array for writing to subprocess */
}
/** @brief Update poll array for writing to subprocess */
@@
-111,7
+113,7
@@
static int command_ready(void) {
const struct speaker_backend command_backend = {
BACKEND_COMMAND,
const struct speaker_backend command_backend = {
BACKEND_COMMAND,
-
FIXED_FORMAT
,
+
0
,
command_init,
0, /* activate */
command_play,
command_init,
0, /* activate */
command_play,