+static void WriteSoundControlToPipe(struct SoundControl snd_ctrl)
+{
+ if (audio.mixer_pid == 0) /* we are child process */
+ return;
+
+ if (write(audio.mixer_pipe[1], &snd_ctrl, sizeof(struct SoundControl)) < 0)
+ {
+ Error(ERR_WARN, "cannot pipe to child process -- no sounds");
+ audio.sound_available = audio.sound_enabled = FALSE;
+ return;
+ }
+}
+
+static void ReadSoundControlFromPipe(struct SoundControl *snd_ctrl)
+{
+ if (audio.mixer_pid != 0) /* we are parent process */
+ return;
+
+ if (read(audio.mixer_pipe[0], snd_ctrl, sizeof(struct SoundControl))
+ != sizeof(struct SoundControl))
+ Error(ERR_EXIT_SOUND_SERVER, "broken pipe -- no sounds");
+}
+