X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Ftools%2Fchlog2replog.c;h=ec31ed457fdc521e6c656045e40d0a55d0143a04;hb=5b4e2498d9bccda2be65e005942bcd3eec61486b;hp=434977991494cfc8a7ca970f9e33992d978f4b47;hpb=73db912500316a665638e66e0ff442699b03127b;p=openldap diff --git a/servers/slapd/tools/chlog2replog.c b/servers/slapd/tools/chlog2replog.c index 4349779914..ec31ed457f 100644 --- a/servers/slapd/tools/chlog2replog.c +++ b/servers/slapd/tools/chlog2replog.c @@ -19,7 +19,7 @@ #include "portable.h" #include -#include +#include #include #include @@ -122,8 +122,8 @@ dn2ldap( char *edbdn ) } -#define SEPARATOR(c) (c == ',' || c == ';') -#define SPACE(c) (c == ' ' || c == '\n') +#define SEPARATOR(c) ((c) == ',' || (c) == ';') +#define SPACE(c) ((c) == ' ' || (c) == '\n') static int dn2ldif( PS ps, DN dn ) @@ -413,7 +413,7 @@ print_as(Attr_Sequence as, int modtype, FILE *ofp) } if ( obuf != NULL ) { fputs( obuf, ofp ); - free( obuf ); + ber_memfree( obuf ); } } if ( modtype != 0 ) { @@ -473,13 +473,13 @@ main( int argc, char **argv ) break; default: usage( progname ); - exit( 1 ); + exit( EXIT_FAILURE ); } } if (( dn_suffix == NULL ) || ( nreplicas == 0 )) { usage( progname ); - exit( 1 ); + exit( EXIT_FAILURE ); } if ( ofile == NULL ) { @@ -494,12 +494,12 @@ main( int argc, char **argv ) if (( std_ps = ps_alloc( std_open )) == NULLPS || std_setup( std_ps, ofp ) != OK ) { fprintf( stderr, "std_ps setup failed - help!\n" ); - exit( 1 ); + exit( EXIT_FAILURE ); } if (( rps = ps_alloc( str_open )) == NULLPS || str_setup( rps, NULLCP, 0, 0 ) != OK ) { fprintf( stderr, "rps setup failed - help!\n" ); - exit( 1 ); + exit( EXIT_FAILURE ); } @@ -569,7 +569,7 @@ main( int argc, char **argv ) if ( ofile != NULL ) { if (( ofp = lock_fopen( ofile, "a", &lfp )) == NULL ) { perror( "open" ); - exit( 1 ); + exit( EXIT_FAILURE ); } } /* @@ -697,5 +697,5 @@ main( int argc, char **argv ) sprintf( nbuf, "%s.lock", ofile ); (void) unlink( nbuf ); } - exit( 0 ); + exit( EXIT_SUCCESS ); }