From 09a58b6813c078a64cf61be4d2ba98e26b4c88b3 Mon Sep 17 00:00:00 2001 From: Diego Elio 'Flameeyes' Pettenò Date: Fri, 20 Nov 2009 21:24:46 +0100 Subject: Don't declare the variable l if FIONREAD is not defined. This avoids two warnings due to FIONREAD not being defined. --- src/modules/module-pipe-sink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/modules/module-pipe-sink.c') diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c index 10cc3415..f06d1ee6 100644 --- a/src/modules/module-pipe-sink.c +++ b/src/modules/module-pipe-sink.c @@ -101,9 +101,10 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse case PA_SINK_MESSAGE_GET_LATENCY: { size_t n = 0; - int l; #ifdef FIONREAD + int l; + if (ioctl(u->fd, FIONREAD, &l) >= 0 && l > 0) n = (size_t) l; #endif -- cgit From 4923f3ca773662b2d147bc374995571b5dacdc7f Mon Sep 17 00:00:00 2001 From: Diego Elio 'Flameeyes' Pettenò Date: Fri, 20 Nov 2009 21:25:33 +0100 Subject: Include sys/filio.h if present; this makes use of FIONREAD on Solaris. FIONREAD on OpenSolaris is declared in sys/filio.h. The RTP modules already rely on the presence of FIONREAD, and check for the header, so this brings the pipe source and sink modules on par with them. --- src/modules/module-pipe-sink.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/modules/module-pipe-sink.c') diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c index f06d1ee6..7a4e730f 100644 --- a/src/modules/module-pipe-sink.c +++ b/src/modules/module-pipe-sink.c @@ -34,6 +34,10 @@ #include #include +#ifdef HAVE_SYS_FILIO_H +#include +#endif + #include #include -- cgit