From e0dcbe8dd1d89670a2b4df0415b41b66b70fe487 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 21 May 2006 10:06:15 +0000 Subject: r15769: this functions belong to params/ so move it. metze (This used to be commit 9c4c40772bfd8a8324cd086c2234451d164be5d0) --- source4/param/loadparm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source4/param') diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index c46cf51f4b..183cec802d 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -2543,6 +2543,24 @@ int lp_servicenumber(const char *pszServiceName) return (iService); } +int lp_find_valid_service(const char *pszServiceName) +{ + int iService; + + iService = lp_servicenumber(pszServiceName); + + if (iService >= 0 && !lp_snum_ok(iService)) { + DEBUG(0,("lp_find_valid_service: Invalid snum %d for '%s'\n",iService, pszServiceName)); + iService = -1; + } + + if (iService == -1) { + DEBUG(3,("lp_find_valid_service: failed to find service '%s'\n", pszServiceName)); + } + + return iService; +} + /******************************************************************* A useful volume label function. ********************************************************************/ -- cgit