From d5bb38f7e517915f5b2776539c907006c0273505 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 8 Sep 2006 18:25:34 +0000 Subject: [PATCH] complain if "-T" is not the first option --- servers/slapd/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 8b1ee9c9c6..e3693d02ed 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -369,6 +369,7 @@ int main( int argc, char **argv ) size_t l; int slapd_pid_file_unlink = 0, slapd_args_file_unlink = 0; + int firstopt = 1; #ifdef CSRIMALLOC FILE *leakfile; @@ -623,6 +624,12 @@ int main( int argc, char **argv ) break; case 'T': + if ( firstopt == 0 ) { + fprintf( stderr, "warning: \"-T %s\" " + "should be the first option.\n", + optarg ); + } + /* try full option string first */ for ( i = 0; tools[i].name; i++ ) { if ( strcmp( optarg, &tools[i].name[4] ) == 0 ) { @@ -653,6 +660,10 @@ unhandled_option:; SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 15 ); goto stop; } + + if ( firstopt ) { + firstopt = 0; + } } ber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &slap_debug); -- 2.39.5