]> git.alsa-project.org Git - alsa-lib.git/commitdiff
- added --with-tmpdir configure option.
authorTakashi Iwai <tiwai@suse.de>
Mon, 9 Feb 2004 17:04:09 +0000 (17:04 +0000)
committerTakashi Iwai <tiwai@suse.de>
Mon, 9 Feb 2004 17:04:09 +0000 (17:04 +0000)
  the directory used for socket files of direct pcm plugins.

configure.in
src/pcm/pcm_direct.c

index aef87486794bd5593ad4873ef44297f14f69c75f..a62a40d1f726f56221b3902789aedab3be0edc11 100644 (file)
@@ -116,6 +116,14 @@ else
   AC_MSG_RESULT(no)
 fi
 
+dnl Temporary directory
+AC_MSG_CHECKING(for tmpdir)
+AC_ARG_WITH(tmpdir,
+  [  --with-tmpdir=directory   directory to put tmp socket files (/tmp)],
+  tmpdir="$withval", tmpdir="/tmp")
+AC_MSG_RESULT($tmpdir)
+AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [directory to put tmp socket files])
+
 dnl Check for softfloat...
 AC_MSG_CHECKING(for softfloat)
 AC_ARG_WITH(softfloat,
index 9b011aac0e2c6b5cc97ed99dc2a35f7b993907e6..33c3e6ddf372e68be8f1922fb9317ed0c43499f6 100644 (file)
@@ -152,7 +152,7 @@ static int get_tmp_name(char *filename, size_t size)
        struct timeval tv;
 
        gettimeofday(&tv, NULL);
-       snprintf(filename, size, "/tmp/alsa-dmix-%i-%li-%li", getpid(), tv.tv_sec, tv.tv_usec);
+       snprintf(filename, size, TMPDIR "/alsa-dmix-%i-%li-%li", getpid(), tv.tv_sec, tv.tv_usec);
        filename[size-1] = '\0';
        return 0;
 }
@@ -179,18 +179,18 @@ static int make_local_socket(const char *filename, int server, mode_t ipc_perm)
        if (server) {
                if (bind(sock, (struct sockaddr *) addr, size) < 0) {
                        int result = -errno;
-                       SYSERR("bind failed");
+                       SYSERR("bind failed: %s", filename);
                        return result;
                } else {
                        if (chmod(filename, ipc_perm) < 0) {
                                int result = -errno;
-                               SYSERR("chmod failed");
+                               SYSERR("chmod failed: %s", filename);
                                return result;
                        }
                }
        } else {
                if (connect(sock, (struct sockaddr *) addr, size) < 0) {
-                       SYSERR("connect failed");
+                       SYSERR("connect failed: %s", filename);
                        return -errno;
                }
        }