]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/tools/edb2ldif.c
Split out schema initialization of builtin syntax/matching rule
[openldap] / servers / slapd / tools / edb2ldif.c
index 85454dca1b19f614c2b78efd25c47aea0edae558..0ef3fb8edcab60c4532487aea4a42ab9577b33da 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright (c) 1995 Regents of the University of Michigan.
  * All rights reserved.
@@ -137,7 +138,7 @@ main( int argc, char **argv )
            } else if (( always_addvals = read_file( optarg, &always_addlen ))
                    == NULL ) {
                print_err( optarg );
-               exit( 1 );
+               exit( EXIT_FAILURE );
            }
            break;
 
@@ -161,7 +162,7 @@ main( int argc, char **argv )
            }
            if ( file_attr_directory == NULL ) {
                print_err( "malloc" );
-               exit( 1 );
+               exit( EXIT_FAILURE );
            }
 #else /* HAVE_FILE_ATTR_DIR */
            fprintf( stderr, "Ignoring -f:  this option requires a newer version of ISODE.\n" );
@@ -181,7 +182,7 @@ main( int argc, char **argv )
            }
            if ( ignore_attr == NULL ) {
                print_err( "malloc/realloc" );
-               exit( 1 );
+               exit( EXIT_FAILURE );
            }
            ignore_attr[ ignore_count ] = optarg;
            ignore_attr[ ++ignore_count ] = NULL;
@@ -194,7 +195,7 @@ main( int argc, char **argv )
 
     if ( errflg ) {
        fprintf( stderr, usage, progname );
-       exit( 1 );
+       exit( EXIT_FAILURE );
     }
 
     if ( basedn == NULL ) {
@@ -213,7 +214,7 @@ main( int argc, char **argv )
     if ( init_syntaxes() < 0 ) {
        fprintf( stderr, "%s: init_syntaxes failed -- check your oid tables \n",
            progname );
-       exit( 1 );
+       exit( EXIT_FAILURE );
     }
 
 
@@ -242,7 +243,7 @@ main( int argc, char **argv )
     fprintf( stderr, "edb2ldif: exit( %d )\n", ( rc < 0 ) ? 1 : 0 );
 #endif
 
-    exit( ( rc < 0 ) ? 1 : 0 );
+    exit( ( rc < 0 ) ? EXIT_FAILURE : EXIT_SUCCESS );
 }
 
 
@@ -863,7 +864,7 @@ print_err( char *msg )
 #endif
 
     if ( errno > sys_nerr ) {
-       fprintf( stderr, "%s: %s: error %d\n", progname, msg, errno );
+       fprintf( stderr, "%s: %s: errno=%d\n", progname, msg, errno );
     } else {
        fprintf( stderr, "%s: %s: %s\n", progname, msg, sys_errlist[ errno ] );
     }