From: Pierangelo Masarati Date: Fri, 8 Sep 2006 18:25:34 +0000 (+0000) Subject: complain if "-T" is not the first option X-Git-Tag: OPENLDAP_REL_ENG_2_3_MP~192 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d5bb38f7e517915f5b2776539c907006c0273505;p=openldap complain if "-T" is not the first option --- 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);