diff options
Diffstat (limited to 'lib/libsndio')
-rw-r--r-- | lib/libsndio/aucat.c | 13 | ||||
-rw-r--r-- | lib/libsndio/mio_thru.c | 15 |
2 files changed, 23 insertions, 5 deletions
diff --git a/lib/libsndio/aucat.c b/lib/libsndio/aucat.c index 65cef3bb5d7..f79f235d532 100644 --- a/lib/libsndio/aucat.c +++ b/lib/libsndio/aucat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aucat.c,v 1.35 2010/04/06 20:07:01 ratchov Exp $ */ +/* $OpenBSD: aucat.c,v 1.36 2010/04/22 17:43:30 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -225,7 +225,16 @@ sio_open_aucat(const char *str, unsigned mode, int nbio) if (errno == EINTR) continue; DPERROR("sio_open_aucat: connect"); - goto bad_connect; + /* try shared server */ + snprintf(ca.sun_path, sizeof(ca.sun_path), + "/tmp/aucat/softaudio%s", unit); + while (connect(s, (struct sockaddr *)&ca, len) < 0) { + if (errno == EINTR) + continue; + DPERROR("sio_open_aucat: connect"); + goto bad_connect; + } + break; } if (fcntl(s, F_SETFD, FD_CLOEXEC) < 0) { DPERROR("FD_CLOEXEC"); diff --git a/lib/libsndio/mio_thru.c b/lib/libsndio/mio_thru.c index eb5dd81bdcc..1413f9ee5c2 100644 --- a/lib/libsndio/mio_thru.c +++ b/lib/libsndio/mio_thru.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mio_thru.c,v 1.6 2009/10/22 22:26:49 ratchov Exp $ */ +/* $OpenBSD: mio_thru.c,v 1.7 2010/04/22 17:43:30 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -82,8 +82,17 @@ thru_open(const char *str, char *sock, unsigned mode, int nbio) if (errno == EINTR) continue; DPERROR("thru_open: connect"); - goto bad_connect; - } + /* try shared server */ + snprintf(ca.sun_path, sizeof(ca.sun_path), + "/tmp/aucat/%s%s", sock, str); + while (connect(s, (struct sockaddr *)&ca, len) < 0) { + if (errno == EINTR) + continue; + DPERROR("thru_open: connect"); + goto bad_connect; + } + break; + } if (fcntl(s, F_SETFD, FD_CLOEXEC) < 0) { DPERROR("FD_CLOEXEC"); goto bad_connect; |