merges from -head

This commit is contained in:
Alexandre Ratchov 2015-10-01 08:56:06 +02:00
parent 3fd4e5524b
commit 2d90528559
5 changed files with 32 additions and 40 deletions

View File

@ -75,7 +75,7 @@ Start, stop and relocate playback and recording.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl Ar b size
.It Fl b Ar size
The buffer size of the audio device in frames.
Default is 7680.
.It Xo

View File

@ -245,21 +245,17 @@ static int
aucat_mkcookie(unsigned char *cookie)
{
struct stat sb;
char buf[PATH_MAX], tmp[PATH_MAX], *path;
char *home, path[PATH_MAX], tmp[PATH_MAX];
ssize_t len;
int fd;
/*
* try to load the cookie
*/
path = issetugid() ? NULL : getenv("AUCAT_COOKIE");
if (path == NULL) {
path = issetugid() ? NULL : getenv("HOME");
if (path == NULL)
goto bad_gen;
snprintf(buf, PATH_MAX, "%s/.aucat_cookie", path);
path = buf;
}
home = issetugid() ? NULL : getenv("HOME");
if (home == NULL)
goto bad_gen;
snprintf(path, PATH_MAX, "%s/.aucat_cookie", home);
fd = open(path, O_RDONLY);
if (fd < 0) {
if (errno != ENOENT)
@ -301,7 +297,7 @@ bad_gen:
/*
* try to save the cookie
*/
if (path == NULL)
if (home == NULL)
return 1;
if (strlcpy(tmp, path, PATH_MAX) >= PATH_MAX ||
strlcat(tmp, ".XXXXXXXX", PATH_MAX) >= PATH_MAX) {

View File

@ -30,21 +30,21 @@
.Sh SYNOPSIS
.In sndio.h
.Ft "struct mio_hdl *"
.Fn "mio_open" "const char *name" "unsigned int mode" "int nbio_flag"
.Fn mio_open "const char *name" "unsigned int mode" "int nbio_flag"
.Ft "void"
.Fn "mio_close" "struct mio_hdl *hdl"
.Fn mio_close "struct mio_hdl *hdl"
.Ft "size_t"
.Fn "mio_read" "struct mio_hdl *hdl" "void *addr" "size_t nbytes"
.Fn mio_read "struct mio_hdl *hdl" "void *addr" "size_t nbytes"
.Ft "size_t"
.Fn "mio_write" "struct mio_hdl *hdl" "const void *addr" "size_t nbytes"
.Fn mio_write "struct mio_hdl *hdl" "const void *addr" "size_t nbytes"
.Ft "int"
.Fn "mio_nfds" "struct mio_hdl *hdl"
.Fn mio_nfds "struct mio_hdl *hdl"
.Ft "int"
.Fn "mio_pollfd" "struct mio_hdl *hdl" "struct pollfd *pfd" "int events"
.Fn mio_pollfd "struct mio_hdl *hdl" "struct pollfd *pfd" "int events"
.Ft "int"
.Fn "mio_revents" "struct mio_hdl *hdl" "struct pollfd *pfd"
.Fn mio_revents "struct mio_hdl *hdl" "struct pollfd *pfd"
.Ft "int"
.Fn "mio_eof" "struct mio_hdl *hdl"
.Fn mio_eof "struct mio_hdl *hdl"
.Sh DESCRIPTION
The
.Nm sndio

View File

@ -39,39 +39,39 @@
.Sh SYNOPSIS
.In sndio.h
.Ft "struct sio_hdl *"
.Fn "sio_open" "const char *name" "unsigned int mode" "int nbio_flag"
.Fn sio_open "const char *name" "unsigned int mode" "int nbio_flag"
.Ft "void"
.Fn "sio_close" "struct sio_hdl *hdl"
.Fn sio_close "struct sio_hdl *hdl"
.Ft "int"
.Fn "sio_setpar" "struct sio_hdl *hdl" "struct sio_par *par"
.Fn sio_setpar "struct sio_hdl *hdl" "struct sio_par *par"
.Ft "int"
.Fn "sio_getpar" "struct sio_hdl *hdl" "struct sio_par *par"
.Fn sio_getpar "struct sio_hdl *hdl" "struct sio_par *par"
.Ft "int"
.Fn "sio_getcap" "struct sio_hdl *hdl" "struct sio_cap *cap"
.Fn sio_getcap "struct sio_hdl *hdl" "struct sio_cap *cap"
.Ft "int"
.Fn "sio_start" "struct sio_hdl *hdl"
.Fn sio_start "struct sio_hdl *hdl"
.Ft "int"
.Fn "sio_stop" "struct sio_hdl *hdl"
.Fn sio_stop "struct sio_hdl *hdl"
.Ft "size_t"
.Fn "sio_read" "struct sio_hdl *hdl" "void *addr" "size_t nbytes"
.Fn sio_read "struct sio_hdl *hdl" "void *addr" "size_t nbytes"
.Ft "size_t"
.Fn "sio_write" "struct sio_hdl *hdl" "const void *addr" "size_t nbytes"
.Fn sio_write "struct sio_hdl *hdl" "const void *addr" "size_t nbytes"
.Ft "void"
.Fn "sio_onmove" "struct sio_hdl *hdl" "void (*cb)(void *arg, int delta)" "void *arg"
.Fn sio_onmove "struct sio_hdl *hdl" "void (*cb)(void *arg, int delta)" "void *arg"
.Ft "int"
.Fn "sio_nfds" "struct sio_hdl *hdl"
.Fn sio_nfds "struct sio_hdl *hdl"
.Ft "int"
.Fn "sio_pollfd" "struct sio_hdl *hdl" "struct pollfd *pfd" "int events"
.Fn sio_pollfd "struct sio_hdl *hdl" "struct pollfd *pfd" "int events"
.Ft "int"
.Fn "sio_revents" "struct sio_hdl *hdl" "struct pollfd *pfd"
.Fn sio_revents "struct sio_hdl *hdl" "struct pollfd *pfd"
.Ft "int"
.Fn "sio_eof" "struct sio_hdl *hdl"
.Fn sio_eof "struct sio_hdl *hdl"
.Ft "int"
.Fn "sio_setvol" "struct sio_hdl *hdl" "unsigned int vol"
.Fn sio_setvol "struct sio_hdl *hdl" "unsigned int vol"
.Ft "int"
.Fn "sio_onvol" "struct sio_hdl *hdl" "void (*cb)(void *arg, unsigned int vol)" "void *arg"
.Fn sio_onvol "struct sio_hdl *hdl" "void (*cb)(void *arg, unsigned int vol)" "void *arg"
.Ft "void"
.Fn "sio_initpar" "struct sio_par *par"
.Fn sio_initpar "struct sio_par *par"
.\"Fd #define SIO_BPS(bits)
.\"Fd #define SIO_LE_NATIVE
.Sh DESCRIPTION

View File

@ -198,10 +198,6 @@ If a session needs to be shared between multiple users, they
can connect to the server using the same cookie.
.Sh ENVIRONMENT
.Bl -tag -width "AUDIODEVICEXXX" -compact
.It Ev AUCAT_COOKIE
Path to file containing the session cookie to be used
when connecting to
.Xr sndiod 1 .
.It Ev AUDIODEVICE
Audio device to use if the application provides
no device chooser.