From ff9cf1d086013a466bd7d9a585dfb05749dbd5e1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 14 Nov 2005 21:40:59 +0000 Subject: [PATCH] minor cleanups git-svn-id: file:///home/lennart/svn/public/avahi/trunk@959 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-core/server.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/avahi-core/server.c b/avahi-core/server.c index 5790bee..28a9978 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -1636,20 +1636,11 @@ int avahi_server_get_group_of_service(AvahiServer *s, AvahiIfIndex interface, Av assert(type); assert(ret_group); - if (!AVAHI_IF_VALID(interface)) - return avahi_server_set_errno(s, AVAHI_ERR_INVALID_INTERFACE); - - if (!AVAHI_IF_VALID(protocol)) - return avahi_server_set_errno(s, AVAHI_ERR_INVALID_PROTOCOL); - - if (!avahi_is_valid_service_name(name)) - return avahi_server_set_errno(s, AVAHI_ERR_INVALID_SERVICE_NAME); - - if (!avahi_is_valid_service_type_strict(type)) - return avahi_server_set_errno(s, AVAHI_ERR_INVALID_SERVICE_TYPE); - - if (domain && !avahi_is_valid_domain_name(domain)) - return avahi_server_set_errno(s, AVAHI_ERR_INVALID_DOMAIN_NAME); + AVAHI_CHECK_VALIDITY(s, AVAHI_IF_VALID(interface), AVAHI_ERR_INVALID_INTERFACE); + AVAHI_CHECK_VALIDITY(s, AVAHI_PROTO_VALID(protocol), AVAHI_ERR_INVALID_PROTOCOL); + AVAHI_CHECK_VALIDITY(s, avahi_is_valid_service_name(name), AVAHI_ERR_INVALID_SERVICE_NAME); + AVAHI_CHECK_VALIDITY(s, avahi_is_valid_service_type_strict(type), AVAHI_ERR_INVALID_SERVICE_TYPE); + AVAHI_CHECK_VALIDITY(s, !domain || avahi_is_valid_domain_name(domain), AVAHI_ERR_INVALID_DOMAIN_NAME); if ((ret = avahi_service_name_join(n, sizeof(n), name, type, domain) < 0)) return avahi_server_set_errno(s, ret); -- 2.39.5