aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-08-12 17:17:21 +0200
committerTakashi Iwai <tiwai@suse.de>2009-08-12 17:17:21 +0200
commite83eaee21ce27beb3ed122aa2426b47d8324651a (patch)
tree1d003475c6cbd070f177f60a8750e14745e902cd
parentc79c5a8fc8ad6d460a0a9b3dd335f0c7bdefbe49 (diff)
downloadsalsa-lib-e83eaee21ce27beb3ed122aa2426b47d8324651a.tar.gz
Add --disable-delight-valgrind configure option
Added --disable-delight-valgrind configure option to turn on/off the initializations for ioctl structs.
-rw-r--r--configure.ac8
-rw-r--r--src/pcm.c12
2 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index f6b76d2..ec81df9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,6 +153,14 @@ else
fi
AC_SUBST(SALSA_MARK_DEPRECATED)
+AC_ARG_ENABLE(libasound,
+ AS_HELP_STRING([--disable-delight-valgrind],
+ [do not initialize unnecessary fields for ioctls]),
+ delight_valgrind="$enableval", delight_valgrind="yes")
+if test "$delight_valgrind" = "yes"; then
+ AC_DEFINE(DELIGHT_VALGRIND)
+fi
+
dnl OK, let's output...
AC_OUTPUT([
diff --git a/src/pcm.c b/src/pcm.c
index ee70cae..88b2dd5 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -200,6 +200,9 @@ snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer,
{
struct sndrv_xferi xferi;
+#ifdef DELIGHT_VALGRIND
+ xferi.result = 0;
+#endif
xferi.buf = (char*) buffer;
xferi.frames = size;
if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_WRITEI_FRAMES, &xferi) < 0)
@@ -213,6 +216,9 @@ snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs,
{
struct sndrv_xfern xfern;
+#ifdef DELIGHT_VALGRIND
+ xfern.result = 0;
+#endif
xfern.bufs = bufs;
xfern.frames = size;
if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_WRITEN_FRAMES, &xfern) < 0)
@@ -226,6 +232,9 @@ snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer,
{
struct sndrv_xferi xferi;
+#ifdef DELIGHT_VALGRIND
+ xferi.result = 0;
+#endif
xferi.buf = buffer;
xferi.frames = size;
if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_READI_FRAMES, &xferi) < 0)
@@ -239,6 +248,9 @@ snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs,
{
struct sndrv_xfern xfern;
+#ifdef DELIGHT_VALGRIND
+ xfern.result = 0;
+#endif
xfern.bufs = bufs;
xfern.frames = size;
if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_READN_FRAMES, &xfern) < 0)