From ce367bcc25e56ce7dd707986775e2f24d365ba02 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 24 Nov 2005 21:21:27 +0000 Subject: [PATCH] use friendly form for timeouts --- servers/slapd/back-meta/config.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/servers/slapd/back-meta/config.c b/servers/slapd/back-meta/config.c index 41b9adfabe..ea78c2037b 100644 --- a/servers/slapd/back-meta/config.c +++ b/servers/slapd/back-meta/config.c @@ -346,6 +346,8 @@ meta_back_db_config( /* network timeout when connecting to ldap servers */ } else if ( strcasecmp( argv[ 0 ], "network-timeout" ) == 0 ) { + unsigned long t; + if ( argc != 2 ) { Debug( LDAP_DEBUG_ANY, "%s: line %d: missing network timeout in \"network-timeout \" line\n", @@ -353,19 +355,16 @@ meta_back_db_config( return 1; } - if ( lutil_atoi( &mi->mi_network_timeout, argv[ 1 ] ) ) { + if ( lutil_parse_time( argv[ 1 ], &t ) ) { Debug( LDAP_DEBUG_ANY, "%s: line %d: unable to parse timeout \"%s\" in \"network-timeout \" line\n", fname, lineno, argv[ 1 ] ); return 1; - } else if ( mi->mi_network_timeout < 0 ) { - Debug( LDAP_DEBUG_ANY, - "%s: line %d: ilegal negative timeout in \"network-timeout \" line\n", - fname, lineno, argv[ 1 ] ); - return 1; } + mi->mi_network_timeout = (int)t; + /* name to use for meta_back_group */ } else if ( strcasecmp( argv[ 0 ], "acl-authcDN" ) == 0 || strcasecmp( argv[ 0 ], "binddn" ) == 0 ) -- 2.39.5