diff options
| author | Lennart Poettering <lennart@poettering.net> | 2010-02-18 02:32:35 +0100 | 
|---|---|---|
| committer | Lennart Poettering <lennart@poettering.net> | 2010-02-18 02:32:35 +0100 | 
| commit | 96ec29c6b2a40d3851f46587143a4ba6dce29d0d (patch) | |
| tree | 063b048225c9e4e2bada481851f750106514b2d6 | |
| parent | 19fa81bf1375032cb1a27c7715a28a52b238d4cb (diff) | |
pacmd: store away fd type
| -rw-r--r-- | src/utils/pacmd.c | 9 | 
1 files changed, 5 insertions, 4 deletions
diff --git a/src/utils/pacmd.c b/src/utils/pacmd.c index 5ef57e3b..59aae480 100644 --- a/src/utils/pacmd.c +++ b/src/utils/pacmd.c @@ -61,6 +61,7 @@ int main(int argc, char*argv[]) {      char *cli;      pa_bool_t ibuf_eof, obuf_eof, ibuf_closed, obuf_closed;      struct pollfd pollfd[N_WATCH]; +    int stdin_type = 0, stdout_type = 0, fd_type = 0;      setlocale(LC_ALL, "");      bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR); @@ -166,7 +167,7 @@ int main(int argc, char*argv[]) {              ssize_t r;              pa_assert(!ibuf_length); -            if ((r = pa_read(STDIN_FILENO, ibuf, sizeof(ibuf), NULL)) <= 0) { +            if ((r = pa_read(STDIN_FILENO, ibuf, sizeof(ibuf), &stdin_type)) <= 0) {                  if (r < 0) {                      pa_log(_("read(): %s"), strerror(errno));                      goto fail; @@ -183,7 +184,7 @@ int main(int argc, char*argv[]) {              ssize_t r;              pa_assert(!obuf_length); -            if ((r = pa_read(fd, obuf, sizeof(obuf), NULL)) <= 0) { +            if ((r = pa_read(fd, obuf, sizeof(obuf), &fd_type)) <= 0) {                  if (r < 0) {                      pa_log(_("read(): %s"), strerror(errno));                      goto fail; @@ -203,7 +204,7 @@ int main(int argc, char*argv[]) {              ssize_t r;              pa_assert(obuf_length); -            if ((r = pa_write(STDOUT_FILENO, obuf + obuf_index, obuf_length, NULL)) < 0) { +            if ((r = pa_write(STDOUT_FILENO, obuf + obuf_index, obuf_length, &stdout_type)) < 0) {                  pa_log(_("write(): %s"), strerror(errno));                  goto fail;              } @@ -219,7 +220,7 @@ int main(int argc, char*argv[]) {              ssize_t r;              pa_assert(ibuf_length); -            if ((r = pa_write(fd, ibuf + ibuf_index, ibuf_length, NULL)) < 0) { +            if ((r = pa_write(fd, ibuf + ibuf_index, ibuf_length, &fd_type)) < 0) {                  pa_log(_("write(): %s"), strerror(errno));                  goto fail;              }  | 
