From 57e473b61cf373f8d9befb03d359b999eca4262b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 4 Sep 2004 00:27:36 +0000 Subject: add support for automatic termination of the daemon after the last client quit remove all gcc warnings add boolean types for tagstruct and modargs git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@178 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/module-protocol-stub.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'polyp/module-protocol-stub.c') diff --git a/polyp/module-protocol-stub.c b/polyp/module-protocol-stub.c index e681732f..4d86c28e 100644 --- a/polyp/module-protocol-stub.c +++ b/polyp/module-protocol-stub.c @@ -83,15 +83,16 @@ static const char* const valid_modargs[] = { static struct pa_socket_server *create_socket_server(struct pa_core *c, struct pa_modargs *ma) { struct pa_socket_server *s; #ifdef USE_TCP_SOCKETS - uint32_t loopback = 1, port = IPV4_PORT; + int loopback = 1; + uint32_t port = IPV4_PORT; - if (pa_modargs_get_value_u32(ma, "loopback", &loopback) < 0) { + if (pa_modargs_get_value_boolean(ma, "loopback", &loopback) < 0) { fprintf(stderr, "loopback= expects a numerical argument.\n"); return NULL; } - if (pa_modargs_get_value_u32(ma, "port", &port) < 0) { - fprintf(stderr, "port= expects a numerical argument.\n"); + if (pa_modargs_get_value_u32(ma, "port", &port) < 0 || port < 1 || port > 0xFFFF) { + fprintf(stderr, "port= expects a numerical argument between 1 and 65535.\n"); return NULL; } -- cgit