summaryrefslogtreecommitdiff
path: root/usr.bin/aucat/listen.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-11-16 16:30:23 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-11-16 16:30:23 +0000
commit1ceac89becb8b9bfe05eeeadda1ddb4f289cd2ed (patch)
tree5f727297157c40b204558195377f59ab6101228b /usr.bin/aucat/listen.c
parent04ff6503a6913923896c17eec5af905fbced51a6 (diff)
Make clients inherit the volume parameter when the -v option is used in
server mode. It gives the maximum volume a client may have. This wastes dynamic range, but allows volume to stay constant when other clients connect or disconnect.
Diffstat (limited to 'usr.bin/aucat/listen.c')
-rw-r--r--usr.bin/aucat/listen.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/aucat/listen.c b/usr.bin/aucat/listen.c
index 2e73147e34a..5c10217289b 100644
--- a/usr.bin/aucat/listen.c
+++ b/usr.bin/aucat/listen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: listen.c,v 1.2 2008/10/29 22:40:56 ratchov Exp $ */
+/* $OpenBSD: listen.c,v 1.3 2008/11/16 16:30:22 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -46,7 +46,7 @@ struct fileops listen_ops = {
};
struct listen *
-listen_new(struct fileops *ops, char *path)
+listen_new(struct fileops *ops, char *path, int maxweight)
{
int sock;
struct sockaddr_un sockname;
@@ -83,6 +83,7 @@ listen_new(struct fileops *ops, char *path)
exit(1);
}
f->fd = sock;
+ f->maxweight = maxweight;
return f;
}
@@ -122,7 +123,7 @@ listen_revents(struct file *file, struct pollfd *pfd)
close(sock);
return 0;
}
- (void)sock_new(&sock_ops, sock, "socket");
+ (void)sock_new(&sock_ops, sock, "socket", f->maxweight);
}
return 0;
}