- added --with-tmpdir configure option.

the directory used for socket files of direct pcm plugins.
This commit is contained in:
Takashi Iwai 2004-02-09 17:04:09 +00:00
parent de88f0e586
commit 3ade181c4f
2 changed files with 12 additions and 4 deletions

View 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,

View 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;
}
}