s/exit(1)/exit(EXIT_FAILURE)/

s/exit(0)/exit(EXIT_SUCCESS)/
add <ac/stdlib.h> where needed and other minor header adjustments
This commit is contained in:
Kurt Zeilenga 1999-08-03 18:14:24 +00:00
parent 32ba884d8a
commit df8f7cbb9b
82 changed files with 434 additions and 404 deletions

View file

@ -338,6 +338,15 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name liblber
End Project Dependency
Begin Project Dependency
Project_Dep_Name libldif
End Project Dependency
Begin Project Dependency
Project_Dep_Name libldap
End Project Dependency
Begin Project Dependency
Project_Dep_Name liblutil
End Project Dependency
}}}
###############################################################################

View file

@ -34,12 +34,10 @@
#include <sys/resource.h>
#endif
#include "lber.h"
#include "ldap.h"
#include <ldap.h>
#include "fax500.h"
#include <ldap_defaults.h>
#include "ldap_defaults.h"
#define USER 0
#define GROUP_ERRORS 1

View file

@ -33,8 +33,7 @@
#include <ldap.h>
#include "fax500.h"
#include <ldap_defaults.h>
#include "ldap_defaults.h"
#define DEFAULT_PORT 79
#define DEFAULT_SIZELIMIT 50
@ -219,7 +218,7 @@ main( int argc, char **argv )
if ( fgets( buf, sizeof(buf), stdin ) == NULL
|| buf[0] == '\n' ) {
exit( 1 );
exit( EXIT_FAILURE );
}
i = atoi( buf ) - 1;
e = ldap_first_entry( ld, result );
@ -228,13 +227,13 @@ main( int argc, char **argv )
}
if ( e == NULL ) {
fprintf( stderr, "Invalid choice!\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
print_entry( ld, e );
} else if ( matches == 0 ) {
fprintf( stderr, "No matches found for \"%s\"\n", key );
exit( 1 );
exit( EXIT_FAILURE );
} else {
fprintf( stderr, "Error return from ldap_count_entries\n" );
exit( -1 );
@ -260,7 +259,7 @@ print_entry( LDAP *ld, LDAPMessage *e )
if ( (fax = ldap_get_values( ld, e, "facsimileTelephoneNumber" ))
== NULL ) {
fprintf( stderr, "Entry \"%s\" has no fax number.\n", dn );
exit( 1 );
exit( EXIT_FAILURE );
}
faxmail = faxtotpc( fax[0], NULL );
title = ldap_get_values( ld, e, "title" );

View file

@ -29,10 +29,8 @@
#include <sys/resource.h>
#endif
#include "lber.h"
#include "ldap.h"
#include "disptmpl.h"
#include <ldap.h>
#include <disptmpl.h>
#include "ldap_defaults.h"
@ -54,7 +52,7 @@ static void
usage( char *name )
{
fprintf( stderr, "usage: %s [-l] [-x ldaphost] [-p ldapport] [-f filterfile] [-t templatefile] [-c rdncount]\r\n", name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -108,7 +106,7 @@ main( int argc, char **argv )
if ( getpeername( 0, (struct sockaddr *)&peername,
&peernamelen ) != 0 ) {
perror( "getpeername" );
exit( 1 );
exit( EXIT_FAILURE );
}
}
@ -161,7 +159,7 @@ do_query( void )
if ( (ld = ldap_init( ldaphost, ldapport )) == NULL ) {
fprintf( stderr, FINGER_UNAVAILABLE );
perror( "ldap_init" );
exit( 1 );
exit( EXIT_FAILURE );
}
{
@ -175,7 +173,7 @@ do_query( void )
{
fprintf( stderr, FINGER_UNAVAILABLE );
ldap_perror( ld, "ldap_simple_bind_s" );
exit( 1 );
exit( EXIT_FAILURE );
}
#ifdef HAVE_SYSCONF
@ -202,11 +200,11 @@ do_query( void )
perror( "select" );
else
fprintf( stderr, "connection timed out on input\r\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( fgets( buf, sizeof(buf), stdin ) == NULL )
exit( 1 );
exit( EXIT_FAILURE );
len = strlen( buf );
@ -279,7 +277,7 @@ do_search( LDAP *ld, char *buf )
!= LDAP_SUCCESS && rc != LDAP_SIZELIMIT_EXCEEDED ) {
fprintf( stderr, FINGER_UNAVAILABLE );
ldap_perror( ld, "ldap_search_st" );
exit( 1 );
exit( EXIT_FAILURE );
}
matches = ldap_count_entries( ld, result );
@ -290,7 +288,7 @@ do_search( LDAP *ld, char *buf )
== NULL ) {
fprintf( stderr, "Cannot open filter file (%s)\n",
filterfile );
exit( 1 );
exit( EXIT_FAILURE );
}
for ( fi = ldap_getfirstfilter( fd, "finger", buf );
@ -306,7 +304,7 @@ do_search( LDAP *ld, char *buf )
{
fprintf( stderr, FINGER_UNAVAILABLE );
ldap_perror( ld, "ldap_search_st" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( (matches = ldap_count_entries( ld, result )) != 0 )
@ -330,7 +328,7 @@ do_search( LDAP *ld, char *buf )
fflush( stdout );
} else if ( matches < 0 ) {
fprintf( stderr, "error return from ldap_count_entries\r\n" );
exit( 1 );
exit( EXIT_FAILURE );
} else if ( matches <= FINGER_LISTLIMIT ) {
printf( "%d %s match%s found for \"%s\":\r\n", matches,
ufn ? "UFN" : fi->lfi_desc, matches > 1 ? "es" : "", buf );
@ -431,7 +429,7 @@ do_read( LDAP *ld, LDAPMessage *e )
defvals, entry2textwrite, (void *)stdout, "\r\n", rdncount,
LDAP_DISP_OPT_DOSEARCHACTIONS ) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_entry2text_search" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( tmpllist != NULL ) {

View file

@ -35,16 +35,16 @@
#include <sys/resource.h>
#endif
#include <ldap.h>
#include <disptmpl.h>
#include "ldap_defaults.h"
#include "lber.h"
#include "ldap.h"
#define ldap_debug debug
#include "ldap_log.h"
#include "lutil.h"
#include "disptmpl.h"
int debug;
int dosyslog;
@ -74,7 +74,7 @@ static void
usage( char *name )
{
fprintf( stderr, "usage: %s [-d debuglevel] [-f filterfile] [-t templatefile]\r\n\t[-a] [-l] [-p port] [-x ldaphost] [-b searchbase] [-c rdncount]\r\n", name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -144,7 +144,7 @@ main( int argc, char **argv )
if ( myhost[0] == '\0' && gethostname( myhost, sizeof(myhost) )
== -1 ) {
perror( "gethostname" );
exit( 1 );
exit( EXIT_FAILURE );
}
#endif
@ -222,7 +222,7 @@ main( int argc, char **argv )
do_queries( 0 );
exit( 0 );
exit( EXIT_SUCCESS );
}
for ( ;; ) {
@ -243,7 +243,7 @@ main( int argc, char **argv )
if ( (ns = accept( s, (struct sockaddr *) &from, &fromlen ))
== -1 ) {
if ( debug ) perror( "accept" );
exit( 1 );
exit( EXIT_FAILURE );
}
hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr),
@ -287,7 +287,7 @@ set_socket( int port )
if ( (s = socket( AF_INET, SOCK_STREAM, 0 )) == -1 ) {
perror( "socket" );
exit( 1 );
exit( EXIT_FAILURE );
}
/* set option so clients can't keep us from coming back up */
@ -295,7 +295,7 @@ set_socket( int port )
if ( setsockopt( s, SOL_SOCKET, SO_REUSEADDR, (char *) &one,
sizeof(one) ) < 0 ) {
perror( "setsockopt" );
exit( 1 );
exit( EXIT_FAILURE );
}
/* bind to a name */
@ -304,13 +304,13 @@ set_socket( int port )
addr.sin_port = htons( port );
if ( bind( s, (struct sockaddr *) &addr, sizeof(addr) ) ) {
perror( "bind" );
exit( 1 );
exit( EXIT_FAILURE );
}
/* listen for connections */
if ( listen( s, 5 ) == -1 ) {
perror( "listen" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( debug ) printf("tcp socket allocated, bound, and listening\n");
@ -350,7 +350,7 @@ do_queries( int s )
LDAP *ld;
if ( (fp = fdopen( s, "a+")) == NULL ) {
exit( 1 );
exit( EXIT_FAILURE );
}
timeout.tv_sec = GO500_TIMEOUT;
@ -359,10 +359,10 @@ do_queries( int s )
FD_SET( fileno( fp ), &readfds );
if ( (rc = select( dtblsize, &readfds, 0, 0, &timeout )) <= 0 )
exit( 1 );
exit( EXIT_FAILURE );
if ( fgets( buf, sizeof(buf), fp ) == NULL )
exit( 1 );
exit( EXIT_FAILURE );
len = strlen( buf );
if ( debug ) {
@ -398,7 +398,7 @@ do_queries( int s )
LDAP_SERVER_DOWN, myhost, myport );
fprintf( fp, ".\r\n" );
rewind(fp);
exit( 1 );
exit( EXIT_FAILURE );
} else {
int deref = GO500_DEREF;
ldap_set_option(ld, LDAP_OPT_DEREF, &deref);
@ -410,7 +410,7 @@ do_queries( int s )
rc, myhost, myport );
fprintf( fp, ".\r\n" );
rewind(fp);
exit( 1 );
exit( EXIT_FAILURE );
}
}
@ -443,7 +443,7 @@ do_queries( int s )
ldap_unbind( ld );
}
exit( 1 );
exit( EXIT_FAILURE );
/* NOT REACHED */
}
@ -493,7 +493,7 @@ do_search( LDAP *ld, FILE *fp, char *buf )
if ( (filtd = ldap_init_getfilter( filterfile )) == NULL ) {
fprintf( stderr, "Cannot open filter file (%s)\n",
filterfile );
exit( 1 );
exit( EXIT_FAILURE );
}
tv.tv_sec = GO500_TIMEOUT;
@ -585,7 +585,7 @@ do_read( LDAP *ld, FILE *fp, char *dn )
entry2textwrite, (void *) fp, "\r\n", rdncount,
LDAP_DISP_OPT_DOSEARCHACTIONS ) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_entry2text_search" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( tmpllist != NULL ) {

View file

@ -36,15 +36,14 @@
#endif
#include "lber.h"
#include "ldap.h"
#include <ldap.h>
#include <disptmpl.h>
#define ldap_debug debug
#include "ldap_log.h"
#include "lutil.h"
#include "disptmpl.h"
#include "ldap_defaults.h"
@ -88,7 +87,7 @@ static void
usage( char *name )
{
fprintf( stderr, "usage: %s [-d debuglevel] [-I] [-p port] [-P ldapport] [-l]\r\n\t[-x ldaphost] [-a] [-h helpfile] [-f filterfile] [-t templatefile] [-c rdncount]\r\n", name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -182,7 +181,7 @@ main (int argc, char **argv )
if ( myhost[0] == '\0' && gethostname( myhost, sizeof(myhost) )
== -1 ) {
perror( "gethostname" );
exit( 1 );
exit( EXIT_FAILURE );
}
#endif
@ -248,7 +247,7 @@ main (int argc, char **argv )
tcp_close( 0 );
exit( 0 );
exit( EXIT_SUCCESS );
}
for ( ;; ) {
@ -269,7 +268,7 @@ main (int argc, char **argv )
if ( (ns = accept( s, (struct sockaddr *) &from, &fromlen ))
== -1 ) {
if ( debug ) perror( "accept" );
exit( 1 );
exit( EXIT_FAILURE );
}
hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr),
@ -313,7 +312,7 @@ set_socket( int port )
if ( (s = socket( AF_INET, SOCK_STREAM, 0 )) == -1 ) {
perror( "socket" );
exit( 1 );
exit( EXIT_FAILURE );
}
/* set option so clients can't keep us from coming back up */
@ -321,7 +320,7 @@ set_socket( int port )
if ( setsockopt( s, SOL_SOCKET, SO_REUSEADDR, (char *) &one,
sizeof(one) ) < 0 ) {
perror( "setsockopt" );
exit( 1 );
exit( EXIT_FAILURE );
}
/* bind to a name */
@ -330,13 +329,13 @@ set_socket( int port )
addr.sin_port = htons( port );
if ( bind( s, (struct sockaddr *) &addr, sizeof(addr) ) ) {
perror( "bind" );
exit( 1 );
exit( EXIT_FAILURE );
}
/* listen for connections */
if ( listen( s, 5 ) == -1 ) {
perror( "listen" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( debug )
@ -379,7 +378,7 @@ do_queries( int s )
if ( (fp = fdopen( s, "a+")) == NULL ) {
perror( "fdopen" );
exit( 1 );
exit( EXIT_FAILURE );
}
timeout.tv_sec = GO500GW_TIMEOUT;
@ -388,10 +387,10 @@ do_queries( int s )
FD_SET( fileno( fp ), &readfds );
if ( (rc = select( dtblsize, &readfds, 0, 0, &timeout )) <= 0 )
exit( 1 );
exit( EXIT_FAILURE );
if ( fgets( buf, sizeof(buf), fp ) == NULL )
exit( 1 );
exit( EXIT_FAILURE );
len = strlen( buf );
if ( debug ) {
@ -437,7 +436,7 @@ do_queries( int s )
fprintf( fp, ".\r\n" );
rewind(fp);
exit( 0 );
exit( EXIT_SUCCESS );
/* NOT REACHED */
}
@ -447,7 +446,7 @@ do_queries( int s )
LDAP_SERVER_DOWN, myhost, myport );
fprintf( fp, ".\r\n" );
rewind(fp);
exit( 1 );
exit( EXIT_FAILURE );
}
deref = LDAP_DEREF_ALWAYS;
@ -463,7 +462,7 @@ do_queries( int s )
rc, myhost, myport );
fprintf( fp, ".\r\n" );
rewind(fp);
exit( 1 );
exit( EXIT_FAILURE );
}
switch ( *query++ ) {
@ -487,7 +486,7 @@ do_queries( int s )
fprintf( fp, ".\r\n" );
rewind(fp);
exit( 0 );
exit( EXIT_SUCCESS );
/* NOT REACHED */
}
@ -729,7 +728,7 @@ do_search( LDAP *ld, FILE *fp, char *query )
if ( (filter = strchr( query, '\t' )) == NULL ) {
fprintf( fp, "3Missing filter!\r\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
*filter++ = '\0';
base = query;
@ -757,7 +756,7 @@ do_search( LDAP *ld, FILE *fp, char *query )
#endif
if ( (scope = make_scope( ld, base )) == -1 ) {
fprintf( fp, "3Bad scope\r\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
filtertype = (scope == LDAP_SCOPE_ONELEVEL ?
@ -771,7 +770,7 @@ do_search( LDAP *ld, FILE *fp, char *query )
if ( (filtd = ldap_init_getfilter( filterfile )) == NULL ) {
fprintf( stderr, "Cannot open filter file (%s)\n",
filterfile );
exit( 1 );
exit( EXIT_FAILURE );
}
count = 0;

View file

@ -39,8 +39,7 @@
#include <sys/resource.h>
#endif
#include "lber.h"
#include "ldap.h"
#include <ldap.h>
#include "ldap_defaults.h"

View file

@ -112,7 +112,7 @@ main( int argc, char **argv )
}
if ( errflg || optind < argc ) {
fprintf( stderr, usage, prog );
exit( 1 );
exit( EXIT_FAILURE );
}
#ifdef SIGPIPE
@ -243,7 +243,7 @@ read_hdr( FILE *fp, int offset, char *buf, int MAXSIZEe, char **linep )
if ( dosyslog ) {
syslog( LOG_ERR, "strdup: %m" );
}
exit( 1 );
exit( EXIT_FAILURE );
}
while ( 1 ) {
@ -257,7 +257,7 @@ read_hdr( FILE *fp, int offset, char *buf, int MAXSIZEe, char **linep )
if ( dosyslog ) {
syslog( LOG_ERR, "realloc: %m" );
}
exit( 1 );
exit( EXIT_FAILURE );
}
strcat( hdr, "\n" );
strcat( hdr, *linep );

View file

@ -8,8 +8,6 @@
#include "portable.h"
#include <stdio.h>
#include <ac/stdlib.h>
#include <ac/ctype.h>
@ -17,10 +15,10 @@
#include <ac/syslog.h>
#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
#include <stdio.h>
#include "disptmpl.h"
#include <ldap.h>
#include <disptmpl.h>
#include "rcpt500.h"
#include "ldap_defaults.h"

View file

@ -81,7 +81,7 @@ main( int argc, char **argv )
case 'f': /* read DNs from a file */
if (( fp = fopen( optarg, "r" )) == NULL ) {
perror( optarg );
exit( 1 );
exit( EXIT_FAILURE );
}
break;
case 'd':

View file

@ -26,9 +26,9 @@
#include <lber.h>
#include <ldap.h>
#include <ldif.h>
#include <ldap_defaults.h>
#include "ldif.h"
#include "ldap_defaults.h"
static char *prog;
static char *binddn = NULL;
@ -405,7 +405,7 @@ process_ldif_rec( char *rbuf, int count )
} else if ( strcasecmp( type, T_DN_STR ) == 0 ) {
if (( dn = strdup( value )) == NULL ) {
perror( "strdup" );
exit( 1 );
exit( EXIT_FAILURE );
}
expect_ct = 1;
}
@ -471,7 +471,7 @@ process_ldif_rec( char *rbuf, int count )
if ( strcasecmp( type, T_NEWRDNSTR ) == 0 ) {
if (( newrdn = strdup( value )) == NULL ) {
perror( "strdup" );
exit( 1 );
exit( EXIT_FAILURE );
}
expect_deleteoldrdn = 1;
expect_newrdn = 0;
@ -495,7 +495,7 @@ process_ldif_rec( char *rbuf, int count )
if ( strcasecmp( type, T_NEWSUPSTR ) == 0 ) {
if (( newsup = strdup( value )) == NULL ) {
perror( "strdup" );
exit( 1 );
exit( EXIT_FAILURE );
}
expect_newsup = 0;
} else {
@ -579,7 +579,7 @@ process_ldapmod_rec( char *rbuf )
if ( dn == NULL ) { /* first line contains DN */
if (( dn = strdup( line )) == NULL ) {
perror( "strdup" );
exit( 1 );
exit( EXIT_FAILURE );
}
} else {
if (( p = strchr( line, '=' )) == NULL ) {
@ -682,19 +682,19 @@ addmodifyop( LDAPMod ***pmodsp, int modop, char *attr, char *value, int vlen )
if (( pmods = (LDAPMod **)ber_memrealloc( pmods, (i + 2) *
sizeof( LDAPMod * ))) == NULL ) {
perror( "realloc" );
exit( 1 );
exit( EXIT_FAILURE );
}
*pmodsp = pmods;
pmods[ i + 1 ] = NULL;
if (( pmods[ i ] = (LDAPMod *)ber_memcalloc( 1, sizeof( LDAPMod )))
== NULL ) {
perror( "calloc" );
exit( 1 );
exit( EXIT_FAILURE );
}
pmods[ i ]->mod_op = modop;
if (( pmods[ i ]->mod_type = ber_strdup( attr )) == NULL ) {
perror( "strdup" );
exit( 1 );
exit( EXIT_FAILURE );
}
}
@ -709,25 +709,25 @@ addmodifyop( LDAPMod ***pmodsp, int modop, char *attr, char *value, int vlen )
(struct berval **)ber_memrealloc( pmods[ i ]->mod_bvalues,
(j + 2) * sizeof( struct berval * ))) == NULL ) {
perror( "ber_realloc" );
exit( 1 );
exit( EXIT_FAILURE );
}
pmods[ i ]->mod_bvalues[ j + 1 ] = NULL;
if (( bvp = (struct berval *)ber_memalloc( sizeof( struct berval )))
== NULL ) {
perror( "ber_memalloc" );
exit( 1 );
exit( EXIT_FAILURE );
}
pmods[ i ]->mod_bvalues[ j ] = bvp;
if ( valsfromfiles && *value == '/' ) { /* get value from file */
if ( fromfile( value, bvp ) < 0 ) {
exit( 1 );
exit( EXIT_FAILURE );
}
} else {
bvp->bv_len = vlen;
if (( bvp->bv_val = (char *)ber_memalloc( vlen + 1 )) == NULL ) {
perror( "malloc" );
exit( 1 );
exit( EXIT_FAILURE );
}
SAFEMEMCPY( bvp->bv_val, value, vlen );
bvp->bv_val[ vlen ] = '\0';
@ -926,7 +926,7 @@ read_one_record( FILE *fp )
if (( buf = (char *)realloc( buf, lmax )) == NULL ) {
perror( "realloc" );
exit( 1 );
exit( EXIT_FAILURE );
}
}

View file

@ -78,6 +78,18 @@ Package=<4>
###############################################################################
Project: "setup"=..\..\include\setup.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>

View file

@ -351,7 +351,7 @@ usage (char *s)
fprintf (stderr, " -Y saltlen\tsalt length to use\n");
/* fprintf (stderr, " -y salt\tsalt to use\n"); */
fprintf (stderr, " -z size\tsize limit\n");
exit (1);
exit( EXIT_FAILURE );
}
int

View file

@ -10,8 +10,8 @@
#include <ac/unistd.h>
#include <ldap.h>
#include <ldif.h>
#include "ldif.h"
#include "ldap_defaults.h"
#define DEFSEP "="

View file

@ -28,8 +28,8 @@
#include <lber.h>
#include <ldap.h>
#include <ldap_defaults.h>
#include "ldap_defaults.h"
#include "ud.h"
#ifdef HAVE_KERBEROS

View file

@ -32,7 +32,8 @@
#include <lber.h>
#include <ldap.h>
#include <ldap_defaults.h>
#include "ldap_defaults.h"
#include "ud.h"
static int load_editor( void );

View file

@ -26,7 +26,8 @@
#include <lber.h>
#include <ldap.h>
#include <ldap_defaults.h>
#include "ldap_defaults.h"
#include "ud.h"
static char * bind_and_fetch(char *name);

View file

@ -46,7 +46,7 @@
#include <lber.h>
#include <ldap.h>
#include <ldap_defaults.h>
#include "ldap_defaults.h"
#include "ud.h"
/*
@ -139,10 +139,10 @@ main( int argc, char **argv )
printf(" 64 authentication information\n");
printf(" 128 initialization information\n\n");
format("These are masks, and may be added to form multiple debug levels. For example, '-d 35' would perform a function trace, print out information about the find() function, and would print out information about the output routines too.", 75, 2);
exit(0);
exit( EXIT_SUCCESS );
default:
fprintf(stderr, "Usage: %s [-c filter-config-file] [-d debug-level] [-l ldap-debug-level] [-s server] [-p port] [-V]\n", argv[0]);
exit(-1);
exit( EXIT_FAILURE);
/* NOTREACHED */
}
}
@ -282,7 +282,7 @@ do_commands( void )
#ifdef HAVE_KERBEROS
destroy_tickets();
#endif
exit(0);
exit( EXIT_SUCCESS );
/* NOTREACHED */
}
@ -650,7 +650,7 @@ initialize_client( void )
*/
if ((ld = ldap_init(server, ldap_port)) == NULL) {
fprintf(stderr, " Initialization of LDAP session failed.\n");
exit(0);
exit( EXIT_FAILURE );
/* NOTREACHED */
}
if (ldap_bind_s(ld, (char *) default_bind_object, NULL,
@ -661,7 +661,7 @@ initialize_client( void )
fprintf(stderr, " The LDAP Directory is temporarily unavailable. Please try again later.\n");
if (ld_errno != LDAP_UNAVAILABLE)
ldap_perror(ld, " ldap_bind_s");
exit(0);
exit( EXIT_FAILURE );
/* NOTREACHED */
}
{

View file

@ -26,8 +26,8 @@
#include <lber.h>
#include <ldap.h>
#include <ldap_defaults.h>
#include "ldap_defaults.h"
#include "ud.h"
void
@ -102,7 +102,7 @@ fatal( char *s )
#ifdef HAVE_KERBEROS
destroy_tickets();
#endif
exit(-1);
exit( EXIT_FAILURE );
}
int
@ -451,7 +451,7 @@ Malloc( unsigned int size )
void_ptr = (void *) malloc(size);
if (void_ptr == NULL) {
perror("malloc");
exit(-1);
exit( EXIT_FAILURE );
/*NOTREACHED*/
}
return(void_ptr);

View file

@ -634,7 +634,7 @@ int main(int argc, char **argv)
if (error_flag) {
fprintf(stderr, "usage: %s [-h host] [-p portnumber] [-u X500UserName]\n\t[-c credentials] [-d debug-level]\n",
progname);
exit(2);
exit( EXIT_FAILURE );
}
rc = user_tailor();
@ -642,7 +642,7 @@ int main(int argc, char **argv)
if (!(ld = ldap_init(hostname, portnum))) {
fprintf(stderr, "%s: unable to initialize LDAP session (%s:%d)\n",
progname, hostname, portnum);
exit(2);
exit( EXIT_FAILURE );
}
if (!bind_user())

View file

@ -19,7 +19,7 @@
#include <lber.h>
#include <ldap.h>
#include <ldif.h>
#include "ldif.h"
#include "maint_form.h" /* for HTML Form manipulations */
/* default values */
@ -178,12 +178,12 @@ main(int argc, char ** argv) {
if (strcompare(getenv("REQUEST_METHOD"),"POST"))
{
printf("<p>++ Error - This script should be referenced with a METHOD of POST.\n");
exit(1);
exit( EXIT_FAILURE );
}
if (strcompare(getenv("CONTENT_TYPE"),"application/x-www-form-urlencoded"))
{
printf("<p>++ Error - This script can only be used to decode form results. \n");
exit(1);
exit( EXIT_FAILURE );
}
cl = atoi(getenv("CONTENT_LENGTH"));
@ -209,7 +209,7 @@ main(int argc, char ** argv) {
printf("%s%s%s", "This script expected a 'FORM' value returned ",
"and did not get one. Make sure the HTML used for this ",
"script is correct.");
exit(1);
exit( EXIT_FAILURE );
}
/* Looking for:
@ -341,7 +341,7 @@ main(int argc, char ** argv) {
}
}
printf("</body>\n</html>\n");
exit(1);
exit( EXIT_FAILURE );
}
/*authenticate as nobody */
@ -373,7 +373,7 @@ main(int argc, char ** argv) {
}
}
printf("</body>\n</html>\n");
exit(1);
exit( EXIT_FAILURE );
}
printf("<b>Directory Lookup Results</b>\n<pre>\n");

View file

@ -41,8 +41,7 @@
#include <sys/time.h>
#include <netinet/in.h>
#include "syslog.h"
#include "lber.h"
#include "ldap.h"
#include <ldap.h>
#define EQ(x,y) (strcasecmp(x,y) == 0)

View file

@ -12,16 +12,16 @@
#ifndef _AC_STDLIB_H
#define _AC_STDLIB_H
# include <stdlib.h>
#include <stdlib.h>
/* Not sure if !STDC_HEADERS is needed */
# if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
# include <malloc.h>
# endif
/* Ignore malloc.h if we have STDC_HEADERS */
#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
# include <malloc.h>
#endif
# ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
# define EXIT_FAILURE 1
# endif
#ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
# define EXIT_FAILURE 1
#endif
#endif /* _AC_STDLIB_H */

View file

@ -73,6 +73,10 @@ ldap_str2charray LDAP_P((
char *str,
char *brkstr ));
/* url.c */
void ldap_pvt_hex_unescape LDAP_P(( char *s ));
int ldap_pvt_unhex( int c );
LDAP_END_DECL
#endif

View file

@ -27,7 +27,7 @@ static char avl_version[] = "AVL library version 1.0\n";
#define ROTATERIGHT(x) { \
Avlnode *tmp;\
if ( *(x) == NULL || (*(x))->avl_left == NULL ) {\
(void) fputs("RR error\n", stderr); exit(1); \
(void) fputs("RR error\n", stderr); exit( EXIT_FAILURE ); \
}\
tmp = (*(x))->avl_left;\
(*(x))->avl_left = tmp->avl_right;\
@ -37,7 +37,7 @@ static char avl_version[] = "AVL library version 1.0\n";
#define ROTATELEFT(x) { \
Avlnode *tmp;\
if ( *(x) == NULL || (*(x))->avl_right == NULL ) {\
(void) fputs("RL error\n", stderr); exit(1); \
(void) fputs("RL error\n", stderr); exit( EXIT_FAILURE ); \
}\
tmp = (*(x))->avl_right;\
(*(x))->avl_right = tmp->avl_left;\

View file

@ -47,7 +47,7 @@ main( int argc, char **argv )
case 'f': /* find */
printf( "data? " );
if ( fgets( name, sizeof( name ), stdin ) == NULL )
exit( 0 );
exit( EXIT_SUCCESS );
name[ strlen( name ) - 1 ] = '\0';
if ( (p = (char *) avl_find( tree, name, (AVL_CMP) strcmp ))
== NULL )
@ -58,7 +58,7 @@ main( int argc, char **argv )
case 'i': /* insert */
printf( "data? " );
if ( fgets( name, sizeof( name ), stdin ) == NULL )
exit( 0 );
exit( EXIT_SUCCESS );
name[ strlen( name ) - 1 ] = '\0';
if ( avl_insert( &tree, strdup( name ), (AVL_CMP) strcmp,
avl_dup_error ) != 0 )
@ -67,13 +67,13 @@ main( int argc, char **argv )
case 'd': /* delete */
printf( "data? " );
if ( fgets( name, sizeof( name ), stdin ) == NULL )
exit( 0 );
exit( EXIT_SUCCESS );
name[ strlen( name ) - 1 ] = '\0';
if ( avl_delete( &tree, name, (AVL_CMP) strcmp ) == NULL )
printf( "\nNot found!\n" );
break;
case 'q': /* quit */
exit( 0 );
exit( EXIT_SUCCESS );
break;
case '\n':
break;

View file

@ -36,29 +36,29 @@ main( int argc, char **argv )
/* read the pe from standard in */
if ( (psin = ps_alloc( std_open )) == NULLPS ) {
perror( "ps_alloc" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( std_setup( psin, stdin ) == NOTOK ) {
perror( "std_setup" );
exit( 1 );
exit( EXIT_FAILURE );
}
/* write the pe to standard out */
if ( (psout = ps_alloc( std_open )) == NULLPS ) {
perror( "ps_alloc" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( std_setup( psout, stdout ) == NOTOK ) {
perror( "std_setup" );
exit( 1 );
exit( EXIT_FAILURE );
}
/* pretty print it to standard error */
if ( (pserr = ps_alloc( std_open )) == NULLPS ) {
perror( "ps_alloc" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( std_setup( pserr, stderr ) == NOTOK ) {
perror( "std_setup" );
exit( 1 );
exit( EXIT_FAILURE );
}
while ( (pe = ps2pe( psin )) != NULLPE ) {
@ -66,7 +66,7 @@ main( int argc, char **argv )
pe2ps( psout, pe );
}
exit( 0 );
exit( EXIT_SUCCESS );
#else
fprintf(stderr, "requires ISODE X.500 distribution.\n");
return( EXIT_FAILURE );

View file

@ -12,12 +12,11 @@
*/
#include "portable.h"
#include <stdio.h>
#include <ac/stdlib.h>
#include "lber.h"
#include "ldap.h"
#include <stdio.h>
#include <ldap.h>
int
main(int argc, char **argv)

View file

@ -6,14 +6,14 @@
* DIGEST-MD5 routines
*/
#include <portable.h>
#include "portable.h"
#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/time.h>
#include "ldap-int.h"
#include <ldap_pvt.h>
#include "ldap_pvt.h"
#define TK_NOENDQUOTE -2
#define TK_OUTOFMEM -1

View file

@ -343,7 +343,7 @@ main( int argc, char **argv )
if ( errflg || optind < argc - 1 ) {
fprintf( stderr, usage, argv[ 0 ] );
exit( 1 );
exit( EXIT_FAILURE );
}
printf( "%s( %s, %d )\n",
@ -360,14 +360,14 @@ main( int argc, char **argv )
if ( ld == NULL ) {
perror( cldapflg ? "cldap_open" : "ldap_init" );
exit(1);
exit( EXIT_FAILURE );
}
if ( copyfname != NULL ) {
if ( (ld->ld_sb.sb_fd = open( copyfname, O_WRONLY | O_CREAT,
0600 )) == -1 ) {
perror( copyfname );
exit ( 1 );
exit ( EXIT_FAILURE );
}
ld->ld_sb.sb_options = copyoptions;
}
@ -549,7 +549,7 @@ main( int argc, char **argv )
if ( !cldapflg ) {
ldap_unbind( ld );
}
exit( 0 );
exit( EXIT_SUCCESS );
break;
case 'r': /* result or remove */

View file

@ -21,11 +21,10 @@
#include <sys/file.h>
#endif
#include "lber.h"
#include "ldap.h"
#include <ldap.h>
#include <disptmpl.h>
#include "ldap_log.h"
#include "disptmpl.h"
#include "ldap-int.h"
#include "ldap_defaults.h"

View file

@ -13,12 +13,11 @@
#ifdef HAVE_CONSOLE_H
#include <console.h>
#endif /* MACOS */
#endif /* HAVE_CONSOLE_H */
#include "lber.h"
#include "ldap.h"
#include "disptmpl.h"
#include "srchpref.h"
#include <ldap.h>
#include <disptmpl.h>
#include <srchpref.h>
static void dump_tmpl ( struct ldap_disptmpl *tmpl );
static void dump_srchpref( struct ldap_searchobj *sp );
@ -43,13 +42,13 @@ main( int argc, char **argv )
if (( err = ldap_init_templates( "ldaptemplates.conf", &templates ))
!= 0 ) {
fprintf( stderr, "ldap_init_templates failed (%d)\n", err );
exit( 1 );
exit( EXIT_FAILURE );
}
if (( err = ldap_init_searchprefs( "ldapsearchprefs.conf", &so ))
!= 0 ) {
fprintf( stderr, "ldap_init_searchprefs failed (%d)\n", err );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( argc == 1 ) {
@ -79,7 +78,7 @@ main( int argc, char **argv )
ldap_free_templates( templates );
ldap_free_searchprefs( so );
exit( 0 );
exit( EXIT_SUCCESS );
}

View file

@ -40,8 +40,6 @@ static const char* skip_url_prefix LDAP_P((
const char *url,
int *enclosedp,
int *ldaps ));
static void hex_unescape LDAP_P(( char *s ));
static int unhex( char c );
int
@ -229,7 +227,7 @@ ldap_url_parse( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
if (( q = strchr( url, ':' )) != NULL ) {
*q++ = '\0';
hex_unescape( q );
ldap_pvt_hex_unescape( q );
if( *q == '\0' ) {
LDAP_FREE( url );
@ -240,7 +238,7 @@ ldap_url_parse( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
ludp->lud_port = atoi( q );
}
hex_unescape( url );
ldap_pvt_hex_unescape( url );
ludp->lud_host = LDAP_STRDUP( url );
if( ludp->lud_host == NULL ) {
@ -265,7 +263,7 @@ ldap_url_parse( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
if( *p != '\0' ) {
/* parse dn part */
hex_unescape( p );
ldap_pvt_hex_unescape( p );
ludp->lud_dn = LDAP_STRDUP( p );
} else {
ludp->lud_dn = LDAP_STRDUP( "" );
@ -295,7 +293,7 @@ ldap_url_parse( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
if( *p != '\0' ) {
/* parse attributes */
hex_unescape( p );
ldap_pvt_hex_unescape( p );
ludp->lud_attrs = ldap_str2charray( p, "," );
if( ludp->lud_attrs == NULL ) {
@ -323,7 +321,7 @@ ldap_url_parse( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
if( *p != '\0' ) {
/* parse the scope */
hex_unescape( p );
ldap_pvt_hex_unescape( p );
ludp->lud_scope = str2scope( p );
if( ludp->lud_scope == -1 ) {
@ -351,7 +349,7 @@ ldap_url_parse( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
if( *p != '\0' ) {
/* parse the filter */
hex_unescape( p );
ldap_pvt_hex_unescape( p );
if( ! *p ) {
/* missing filter */
@ -398,7 +396,7 @@ ldap_url_parse( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
}
for( i=0; ludp->lud_exts[i] != NULL; i++ ) {
hex_unescape( ludp->lud_exts[i] );
ldap_pvt_hex_unescape( ludp->lud_exts[i] );
}
if( i == 0 ) {
@ -544,8 +542,8 @@ ldap_url_search_s(
}
static void
hex_unescape( char *s )
void
ldap_pvt_hex_unescape( char *s )
{
/*
* Remove URL hex escapes from s... done in place. The basic concept for
@ -556,10 +554,10 @@ hex_unescape( char *s )
for ( p = s; *s != '\0'; ++s ) {
if ( *s == '%' ) {
if ( *++s != '\0' ) {
*p = unhex( *s ) << 4;
*p = ldap_pvt_unhex( *s ) << 4;
}
if ( *++s != '\0' ) {
*p++ += unhex( *s );
*p++ += ldap_pvt_unhex( *s );
}
} else {
*p++ = *s;
@ -570,8 +568,8 @@ hex_unescape( char *s )
}
static int
unhex( char c )
int
ldap_pvt_unhex( int c )
{
return( c >= '0' && c <= '9' ? c - '0'
: c >= 'A' && c <= 'F' ? c - 'A' + 10

View file

@ -16,6 +16,7 @@
#include "ldap_log.h"
#include "lber_pvt.h"
#include "ldap_pvt.h"
#include "ldif.h"
int
@ -25,13 +26,40 @@ ldif_fetch_url(
ber_len_t *vlenp
)
{
#ifdef HAVE_FETCH
FILE *url = fetchGetURL( (char*) urlstr, "" );
FILE *url;
char buffer[1024];
char *p = NULL;
size_t total;
size_t bytes;
*valuep = NULL;
*vlenp = 0;
#ifdef HAVE_FETCH
url = fetchGetURL( (char*) urlstr, "" );
#else
if( strncasecmp( "file://", urlstr, sizeof("file://")-1 ) == 0 ) {
p = strchr( &urlstr[sizeof("file://")-1], '/' );
if( p == NULL ) {
return -1;
}
if( *p != *LDAP_DIRSEP ) {
/* skip over false root */
p++;
}
p = ber_strdup( p );
ldap_pvt_hex_unescape( p );
url = fopen( p, "r" );
} else {
return -1;
}
#endif
if( url == NULL ) {
return -1;
}
@ -56,11 +84,5 @@ ldif_fetch_url(
*vlenp = total;
return 0;
#else
*valuep = NULL;
*vlenp = 0;
return -1;
#endif
}

View file

@ -123,6 +123,10 @@ LIB32=link.exe -lib
# Name "libldif - Win32 Single Release"
# Begin Source File
SOURCE=.\fetch.c
# End Source File
# Begin Source File
SOURCE=..\..\include\ldif.h
# End Source File
# Begin Source File

View file

@ -65,7 +65,7 @@ lutil_detach( int debug, int do_close )
break;
default:
_exit( 0 );
_exit( EXIT_SUCCESS );
}
break;
}
@ -78,7 +78,7 @@ lutil_detach( int debug, int do_close )
if ( (sd = open( "/dev/null", O_RDWR )) == -1 ) {
perror( "/dev/null" );
exit( 1 );
exit( EXIT_FAILURE );
}
for ( i = 0; i < 3; i++ )
if ( sd != i && isatty( i ) )

View file

@ -35,7 +35,8 @@
#include <lber.h>
#include <ldap.h>
#include <ldap_defaults.h>
#include "ldap_defaults.h"
char *
getpass( const char *prompt )

View file

@ -299,7 +299,7 @@ main (int argc, char **argv )
if (argc < 2)
{
fprintf (stderr, "usage: %s string-to-hash\n", argv[0]);
exit (1);
return EXIT_FAILURE;
}
for (j = 1; j < argc; ++j)
{
@ -313,6 +313,6 @@ main (int argc, char **argv )
}
printf ("\n");
}
return 0;
return EXIT_SUCCESS;
}
#endif /* TEST */

View file

@ -9,7 +9,7 @@
#include <windows.h>
#include <winsvc.h>
#include "ldap.h"
#include <ldap.h>
#define ldap_debug slap_debug
extern int slap_debug;

View file

@ -439,7 +439,7 @@ acl_usage( void )
"\t[domain=<regex>] [sockurl=<regex>]\n"
"<access> ::= [self]{none|auth|compare|search|read|write}\n"
);
exit( 1 );
exit( EXIT_FAILURE );
}
static void

View file

@ -195,7 +195,6 @@ add_created_attrs( Operation *op, Entry *e )
struct berval bv;
struct berval *bvals[2];
Attribute *a;
Attribute *tmp;
struct tm *ltm;
time_t currenttime;

View file

@ -324,7 +324,7 @@ attr_syntax_config(
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), err);
exit( 1 );
exit( EXIT_FAILURE );
}
ldap_memfree(at);
}

View file

@ -128,7 +128,7 @@ bdb2i_txn_attr_config(
if ( open ) {
pthread_kill( pthread_self(), LDAP_SIGUSR1 );
} else {
exit( 1 );
exit( EXIT_FAILURE );
}
}

View file

@ -79,7 +79,7 @@ ldbm_back_startup(
fprintf( stderr,
"ldbm_back_startup(): FATAL error in db_appinit() : %s\n",
error );
exit( 1 );
exit( EXIT_FAILURE );
}
#endif

View file

@ -125,7 +125,7 @@ perl_back_db_config(
if ( return_code != 0 ) {
fprintf( stderr,
"Unknown perl backeng config: %s\n", argv[0]);
exit( 1 );
exit( EXIT_FAILURE );
}
}

View file

@ -50,13 +50,13 @@ forkandexec(
close( c2p[0] );
if ( dup2( p2c[0], 0 ) == -1 || dup2( c2p[1], 1 ) == -1 ) {
Debug( LDAP_DEBUG_ANY, "dup2 failed\n", 0, 0, 0 );
exit( -1 );
exit( EXIT_FAILURE );
}
execv( args[0], args );
Debug( LDAP_DEBUG_ANY, "execv failed\n", 0, 0, 0 );
exit( -1 );
exit( EXIT_FAILURE );
case -1: /* trouble */
Debug( LDAP_DEBUG_ANY, "fork failed\n", 0, 0, 0 );

View file

@ -21,7 +21,7 @@ ch_malloc(
if ( (new = (void *) ber_memalloc( size )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "ch_malloc of %lu bytes failed\n",
(long) size, 0, 0 );
exit( 1 );
exit( EXIT_SUCCESS );
}
return( new );
@ -46,7 +46,7 @@ ch_realloc(
if ( (new = (void *) ber_memrealloc( block, size )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "ch_realloc of %lu bytes failed\n",
(long) size, 0, 0 );
exit( 1 );
exit( EXIT_SUCCESS );
}
return( new );
@ -63,7 +63,7 @@ ch_calloc(
if ( (new = (void *) ber_memcalloc( nelem, size )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "ch_calloc of %lu elems of %lu bytes failed\n",
(long) nelem, (long) size, 0 );
exit( 1 );
exit( EXIT_FAILURE );
}
return( new );
@ -78,7 +78,7 @@ ch_strdup(
if ( (new = ber_strdup( string )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "ch_strdup(%s) failed\n", string, 0, 0 );
exit( 1 );
exit( EXIT_FAILURE );
}
return( new );

View file

@ -655,13 +655,13 @@ read_config( char *fname )
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing filename in \"loadmodule <filename>\" line\n",
fname, lineno, 0 );
exit( 1 );
exit( EXIT_FAILURE );
}
if (!load_module(cargv[1], cargc - 2, (cargc > 2) ? cargv + 2 : NULL)) {
Debug( LDAP_DEBUG_ANY,
"%s: line %d: failed to load or initialize module %s\n",
fname, lineno, cargv[1]);
exit( 1 );
exit( EXIT_FAILURE );
}
#endif /*SLAPD_MODULES*/

View file

@ -856,7 +856,6 @@ slapd_daemon_task(
{
ber_socket_t rd;
int is_listener = 0;
int rc;
#ifdef HAVE_WINSOCK
rd = readfds.fd_array[i];

View file

@ -273,7 +273,7 @@ int main( int argc, char **argv )
case 'c': /* do connectionless (udp) */
/* udp = 1; */
fprintf( stderr, "connectionless support not supported");
exit( -1 );
exit( EXIT_FAILURE );
break;
#endif

View file

@ -2,6 +2,7 @@
#ifdef HAVE_CYRUS_SASL
#include <ac/stdlib.h>
#include <stdio.h>
#include "slap.h"
@ -32,7 +33,7 @@ int sasl_init( void )
if( rc != SASL_OK ) {
Debug( LDAP_DEBUG_ANY, "sasl_server_init failed\n",
0, 0, 0 );
exit(-1);
return EXIT_FAILURE;
}
rc = sasl_server_new( "ldap", NULL, NULL, NULL,
@ -42,7 +43,7 @@ int sasl_init( void )
if( rc != SASL_OK ) {
Debug( LDAP_DEBUG_ANY, "sasl_server_new failed\n",
0, 0, 0 );
exit(-1);
return EXIT_FAILURE;
}
memset(&secprops, 0, sizeof(secprops));
@ -55,7 +56,7 @@ int sasl_init( void )
if( rc != SASL_OK ) {
Debug( LDAP_DEBUG_ANY, "sasl_setprop failed\n",
0, 0, 0 );
exit(-1);
return EXIT_FAILURE;
}
rc = sasl_listmech( server, NULL, NULL, ",", NULL,
@ -64,13 +65,13 @@ int sasl_init( void )
if( rc != SASL_OK ) {
Debug( LDAP_DEBUG_ANY, "sasl_listmech failed: %d\n",
rc, 0, 0 );
exit(-1);
return EXIT_FAILURE;
}
Debug( LDAP_DEBUG_TRACE, "SASL mechanisms: %s\n",
data, 0, 0 );
return 0;
return EXIT_SUCCESS;
}
int sasl_destory( void )

View file

@ -1006,7 +1006,7 @@ schema_init( void )
if ( res ) {
fprintf( stderr, "schema_init: Error registering syntax %s\n",
syntax_defs[i].sd_desc );
exit( 1 );
exit( EXIT_FAILURE );
}
}
for ( i=0; mrule_defs[i].mrd_desc != NULL; i++ ) {
@ -1018,7 +1018,7 @@ schema_init( void )
if ( res ) {
fprintf( stderr, "schema_init: Error registering matching rule %s\n",
mrule_defs[i].mrd_desc );
exit( 1 );
exit( EXIT_FAILURE );
}
}
schema_init_done = 1;

View file

@ -113,7 +113,7 @@ parse_oc_old(
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), *namep);
exit( 1 );
exit( EXIT_FAILURE );
}
namep++;
}
@ -125,7 +125,7 @@ parse_oc_old(
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), *namep);
exit( 1 );
exit( EXIT_FAILURE );
}
namep++;
}
@ -135,7 +135,7 @@ parse_oc_old(
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), err);
exit( 1 );
exit( EXIT_FAILURE );
}
ldap_memfree(oc);
}
@ -161,7 +161,7 @@ parse_oc(
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), err);
exit( 1 );
exit( EXIT_FAILURE );
}
ldap_memfree(oc);
}
@ -180,7 +180,7 @@ oc_usage( void )
fprintf( stderr, " [ \"MUST\" oids ] ; AttributeTypes\n");
fprintf( stderr, " [ \"MAY\" oids ] ; AttributeTypes\n");
fprintf( stderr, "whsp \")\"\n");
exit( 1 );
exit( EXIT_FAILURE );
}
static void
@ -189,7 +189,7 @@ oc_usage_old( void )
fprintf( stderr, "<oc clause> ::= objectclass <ocname>\n" );
fprintf( stderr, " [ requires <attrlist> ]\n" );
fprintf( stderr, " [ allows <attrlist> ]\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
static void
@ -215,7 +215,7 @@ at_usage( void )
fprintf( stderr, " ; distributedOperation\n");
fprintf( stderr, " ; dSAOperation\n");
fprintf( stderr, "whsp \")\"\n");
exit( 1 );
exit( EXIT_FAILURE );
}
void
@ -239,7 +239,7 @@ parse_at(
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), err);
exit( 1 );
exit( EXIT_FAILURE );
}
ldap_memfree(at);
}

View file

@ -68,7 +68,7 @@ main( int argc, char **argv )
if ( errflg || optind < argc ) {
fprintf( stderr, "usage: %s [-d]\n", progname );
exit( 1 );
exit( EXIT_FAILURE );
}
debug_printf( "started\n" );
@ -76,13 +76,13 @@ main( int argc, char **argv )
(void) memset( (char *)&op, '\0', sizeof( op ));
if ( parse_input( stdin, stdout, &op ) < 0 ) {
exit( 0 );
exit( EXIT_SUCCESS );
}
if ( op.ldop_op != LDOP_SEARCH ) {
write_result( stdout, LDAP_UNWILLING_TO_PERFORM, NULL,
"Command Not Implemented" );
exit( 0 );
exit( EXIT_SUCCESS );
}
#ifdef LDAP_DEBUG
@ -91,7 +91,7 @@ main( int argc, char **argv )
pwdfile_search( &op, stdout );
exit( 0 );
exit( EXIT_SUCCESS );
}

View file

@ -275,7 +275,7 @@ estrdup( char *s )
if (( p = strdup( s )) == NULL ) {
debug_printf( "strdup failed\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
return( p );
@ -295,7 +295,7 @@ erealloc( void *s, unsigned size )
if ( p == NULL ) {
debug_printf( "realloc( p, %d ) failed\n", size );
exit( 1 );
exit( EXIT_FAILURE );
}
return( p );
@ -309,7 +309,7 @@ ecalloc( unsigned nelem, unsigned elsize )
if (( p = calloc( nelem, elsize )) == NULL ) {
debug_printf( "calloc( %d, %d ) failed\n", nelem, elsize );
exit( 1 );
exit( EXIT_FAILURE );
}
return( p );

View file

@ -20,10 +20,8 @@
#include "ldap_log.h"
#include "lber.h"
#include "ldap.h"
#include "ldap_schema.h"
#include <ldap.h>
#include <ldap_schema.h>
#include "ldap_pvt_thread.h"
#include "ldif.h"

View file

@ -167,7 +167,7 @@ main( int argc, char **argv )
} else {
fprintf( stderr, "%s: unknown auth method\n", optarg );
fputs( "expecting \"simple\" or \"kerberos\"\n", stderr );
exit( 1 );
exit( EXIT_FAILURE );
}
break;
@ -179,7 +179,7 @@ main( int argc, char **argv )
} else {
fprintf( stderr, "%s: unknown auth method\n", optarg );
fputs( "expecting \"simple\" or \"kerberos\"\n", stderr );
exit( 1 );
exit( EXIT_FAILURE );
}
break;
@ -197,12 +197,12 @@ main( int argc, char **argv )
default:
usage( argv[0] );
exit( 1 );
exit( EXIT_FAILURE );
}
}
if ( optind == argc || ldapsrcurl == NULL || ldapdesturl == NULL ) {
usage( argv[0] );
exit( 1 );
exit( EXIT_FAILURE );
}
attrs = &argv[optind];
@ -213,12 +213,12 @@ main( int argc, char **argv )
if ( (ld = start_ldap_search( ldapsrcurl, ldapfilter, attrs )) == NULL ) {
fprintf( stderr, "could not initiate ldap search\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( create_tmp_files( attrs, &tmpfile, &ldbm ) != 0 ) {
fprintf( stderr, "could not create temp files\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
/*
@ -229,10 +229,10 @@ main( int argc, char **argv )
if ( (count = generate_new_centroids( ld, attrs, ldbm )) < 1 ) {
if ( count == 0 ) {
fprintf( stderr, "no entries matched\n" );
exit( 0 );
exit( EXIT_SUCCESS );
} else {
fprintf( stderr, "could not generate new centroid\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
}
@ -246,7 +246,7 @@ main( int argc, char **argv )
if ( (ld = bind_to_destination_ldap( ldapsrcurl, ldapdesturl )) == NULL ) {
fprintf( stderr,
"could not bind to index server, or could not create index entry\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
for ( i = 0; ldbm[i] != NULL; i++ ) {
@ -338,7 +338,7 @@ main( int argc, char **argv )
free( ldbm );
free( tmpfile );
exit( 0 );
exit( EXIT_SUCCESS );
}
/*
@ -591,7 +591,7 @@ diff_centroids(
(vals[0] = (char *) malloc( 20 )) == NULL )
{
perror( "malloc" );
exit( -1 );
exit( EXIT_FAILURE );
}
/* add values in mods[0] */
mods[0]->mod_op = LDAP_MOD_ADD;
@ -855,7 +855,7 @@ full_centroid(
(vals[0] = (char *) malloc( 20 )) == NULL )
{
perror( "malloc" );
exit( -1 );
exit( EXIT_FAILURE );
}
mods[0]->mod_op = LDAP_MOD_REPLACE;
mods[0]->mod_type = attr;

View file

@ -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 );
}

View file

@ -137,7 +137,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 +161,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 +181,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 +194,7 @@ main( int argc, char **argv )
if ( errflg ) {
fprintf( stderr, usage, progname );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( basedn == NULL ) {
@ -213,7 +213,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 +242,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 );
}

View file

@ -24,8 +24,8 @@
/* #include <quipu/dap2.h> */
#include <quipu/dua.h>
#include "lber.h"
#include "ldap.h"
#include <ldap.h>
#include "ldif.h"
#include "ldapsyntax.h"

View file

@ -77,8 +77,7 @@ main( int argc, char **argv )
fprintf( stderr,
"usage: %s [-d level] [-f slapdconfigfile]\n",
argv[0] );
exit( -1 );
break;
exit( EXIT_FAILURE );
}
}
@ -294,7 +293,7 @@ main( int argc, char **argv )
printf( "suffix: " );
fflush( stdout );
if ( fgets( buf, sizeof(buf), stdin ) == NULL ) {
exit( 0 );
exit( EXIT_SUCCESS );
} else {
buf[strlen( buf ) - 1] = '\0';
}
@ -542,7 +541,7 @@ edit_entry( char c, Datum *data )
}
execl( editor, editor, tmpname, NULL );
perror( "execl" );
exit( 1 );
exit( EXIT_FAILURE );
}
fclose( fp );
@ -579,12 +578,12 @@ openfile( char *name, int namesiz, int mode, int verbose, char c )
if ( c == 'f' ) {
printf( " file: " );
if ( fgets( name, namesiz, stdin ) == NULL )
exit( 0 );
exit( EXIT_SUCCESS );
name[strlen( name ) - 1] = '\0';
} else {
printf( " attr: " );
if ( fgets( name, namesiz, stdin ) == NULL )
exit( 0 );
exit( EXIT_SUCCESS );
name[strlen( name ) - 1] = '\0';
}
}
@ -744,7 +743,7 @@ get_keydata( FILE *fp, char c, Datum *key, Datum *data )
if ( tty )
printf( " dn: " );
if ( fgets( kbuf, sizeof(kbuf), fp ) == NULL ) {
exit( 0 );
exit( EXIT_SUCCESS );
}
kbuf[strlen( kbuf ) - 1] = '\0';
key->dptr = strdup( kbuf );
@ -755,7 +754,7 @@ get_keydata( FILE *fp, char c, Datum *key, Datum *data )
if ( tty )
printf( " dnid: " );
if ( fgets( dbuf, sizeof(dbuf), fp ) == NULL ) {
exit( 0 );
exit( EXIT_SUCCESS );
}
n = atol( dbuf );
data->dptr = (char *) malloc( sizeof(n) );
@ -769,7 +768,7 @@ get_keydata( FILE *fp, char c, Datum *key, Datum *data )
if ( tty )
printf( " dnid: " );
if ( fgets( kbuf, sizeof(kbuf), fp ) == NULL ) {
exit( 0 );
exit( EXIT_SUCCESS );
}
n = atol( kbuf );
key->dptr = (char *) malloc( sizeof(n) );
@ -788,7 +787,7 @@ get_keydata( FILE *fp, char c, Datum *key, Datum *data )
if ( tty )
printf( " key: " );
if ( fgets( kbuf, sizeof(kbuf), fp ) == NULL ) {
exit( 0 );
exit( EXIT_SUCCESS );
}
kbuf[strlen( kbuf ) - 1] = '\0';
key->dptr = strdup( kbuf );

View file

@ -12,15 +12,15 @@
#include <io.h>
#endif
#include "lber.h"
#include "ldap.h"
#include <ldap.h>
#include "ldif.h"
static void
usage( char *name )
{
fprintf( stderr, "usage: %s [-b] <attrtype>\n", name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -54,7 +54,7 @@ main( int argc, char **argv )
if (( val = (char *) malloc( BUFSIZ )) == NULL ) {
perror( "malloc" );
exit( 1 );
return EXIT_FAILURE;
}
max = BUFSIZ;
cur = 0;
@ -64,7 +64,7 @@ main( int argc, char **argv )
if (( val = (char *) realloc( val, max )) ==
NULL ) {
perror( "realloc" );
exit( 1 );
return EXIT_FAILURE;
}
}
memcpy( val + cur, buf, nread );
@ -72,14 +72,14 @@ main( int argc, char **argv )
}
if (( out = ldif_put( LDIF_PUT_BINARY, type, val, cur )) == NULL ) {
perror( "ldif_type_and_value" );
exit( 1 );
perror( "ldif_type_and_value" );
return EXIT_FAILURE;
}
fputs( out, stdout );
ber_memfree( out );
free( val );
exit( 0 );
return EXIT_SUCCESS;
}
/* not binary: one value per line... */
@ -89,12 +89,11 @@ main( int argc, char **argv )
if (( out = ldif_put( LDIF_PUT_VALUE, type, buf, strlen( buf ) ))
== NULL ) {
perror( "ldif_type_and_value" );
exit( 1 );
return EXIT_FAILURE;
}
fputs( out, stdout );
ber_memfree( out );
}
exit( 0 );
return( 0 ); /* NOT REACHED */
return EXIT_SUCCESS;
}

View file

@ -53,7 +53,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 oldif32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libraries\Release"
# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libraries\Release"
!ELSEIF "$(CFG)" == "ldif - Win32 Debug"
@ -77,7 +77,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 oldif32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libraries\Debug"
# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libraries\Debug"
!ELSEIF "$(CFG)" == "ldif - Win32 Single Debug"
@ -102,7 +102,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 oldif32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libraries\Debug"
# ADD LINK32 oldif32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libraries\Debug"
# ADD LINK32 hs_regex.lib libdbs.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libraries\Debug"
!ELSEIF "$(CFG)" == "ldif - Win32 Single Release"
@ -127,7 +127,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 oldif32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libraries\Release"
# ADD LINK32 oldif32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libraries\Release"
# ADD LINK32 hs_regex.lib libdbs.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libraries\Release"
!ENDIF

View file

@ -24,7 +24,7 @@ static void
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-n databasenumber]\n", name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -73,7 +73,7 @@ main( int argc, char **argv )
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
exit( 1 );
exit( EXIT_FAILURE );
}
}
@ -93,15 +93,15 @@ main( int argc, char **argv )
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No bdb2 database found in config file\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
exit( 1 );
exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "bdb2" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an bdb2 database\n", dbnum );
exit( 1 );
exit( EXIT_FAILURE );
}
slap_startup(dbnum);
@ -118,7 +118,7 @@ main( int argc, char **argv )
if ( (db = bdb2i_cache_open( be, "dn2id", BDB2_SUFFIX, LDBM_NEWDB ))
== NULL ) {
perror( "dn2id file" );
exit( 1 );
exit( EXIT_FAILURE );
}
id = 0;
@ -185,7 +185,7 @@ main( int argc, char **argv )
if ( ldbm_store( db->dbc_db, key, data,
LDBM_REPLACE ) != 0 ) {
perror( "dn2id ldbm_store..." );
exit( 1 );
exit( EXIT_FAILURE );
}
}
}
@ -204,7 +204,7 @@ main( int argc, char **argv )
if ( (db2 = bdb2i_cache_open( be, "id2children", BDB2_SUFFIX,
LDBM_NEWDB )) == NULL ) {
perror( "id2children file" );
exit( 1 );
exit( EXIT_FAILURE );
}
rewind( stdin );
@ -297,7 +297,7 @@ main( int argc, char **argv )
if ( bdb2i_idl_insert_key( be, db2, key, id )
!= 0 ) {
perror( "bdb2i_idl_insert_key" );
exit( 1 );
exit( EXIT_FAILURE );
}
}
}
@ -315,5 +315,5 @@ main( int argc, char **argv )
slap_shutdown(dbnum);
slap_destroy();
exit( 0 );
exit( EXIT_SUCCESS );
}

View file

@ -24,7 +24,7 @@ static void
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-n databasenumber]\n", name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -75,7 +75,7 @@ main( int argc, char **argv )
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
exit( 1 );
exit( EXIT_FAILURE );
}
}
@ -95,15 +95,15 @@ main( int argc, char **argv )
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No ldbm database found in config file\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
exit( 1 );
exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "ldbm" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an ldbm database\n", dbnum );
exit( 1 );
exit( EXIT_FAILURE );
}
slap_startup(dbnum);
@ -120,7 +120,7 @@ main( int argc, char **argv )
if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_NEWDB ))
== NULL ) {
perror( "dn2id file" );
exit( 1 );
exit( EXIT_FAILURE );
}
id = 0;
@ -187,7 +187,7 @@ main( int argc, char **argv )
if ( ldbm_store( db->dbc_db, key, data,
LDBM_REPLACE ) != 0 ) {
perror( "dn2id ldbm_store" );
exit( 1 );
exit( EXIT_FAILURE );
}
}
}
@ -206,7 +206,7 @@ main( int argc, char **argv )
if ( (db2 = ldbm_cache_open( be, "id2children", LDBM_SUFFIX,
LDBM_NEWDB )) == NULL ) {
perror( "id2children file" );
exit( 1 );
exit( EXIT_FAILURE );
}
rewind( stdin );
@ -299,7 +299,7 @@ main( int argc, char **argv )
if ( idl_insert_key( be, db2, key, id )
!= 0 ) {
perror( "idl_insert_key" );
exit( 1 );
exit( EXIT_FAILURE );
}
}
}

View file

@ -22,7 +22,7 @@ static void
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-n databasenumber]\n", name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -72,7 +72,7 @@ main( int argc, char **argv )
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
exit( 1 );
exit( EXIT_FAILURE );
}
}
@ -92,15 +92,15 @@ main( int argc, char **argv )
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No bdb2 database found in config file\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
exit( 1 );
exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "bdb2" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an bdb2 database\n", dbnum );
exit( 1 );
exit( EXIT_FAILURE );
}
slap_startup(dbnum);
@ -114,7 +114,7 @@ main( int argc, char **argv )
if ( (db = bdb2i_cache_open( be, "id2entry", BDB2_SUFFIX, LDBM_NEWDB ))
== NULL ) {
perror( "id2entry file" );
exit( 1 );
exit( EXIT_FAILURE );
}
id = 0;
@ -178,7 +178,7 @@ main( int argc, char **argv )
LDBM_INSERT ) != 0 ) {
fputs("id2entry ldbm_store failed\n",
stderr);
exit( 1 );
exit( EXIT_FAILURE );
}
}
*buf = '\0';
@ -198,5 +198,5 @@ main( int argc, char **argv )
slap_destroy();
exit( 0 );
exit( EXIT_SUCCESS );
}

View file

@ -22,7 +22,7 @@ static void
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-n databasenumber]\n", name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -74,7 +74,7 @@ main( int argc, char **argv )
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
exit( 1 );
exit( EXIT_FAILURE );
}
}
@ -94,15 +94,15 @@ main( int argc, char **argv )
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No ldbm database found in config file\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
exit( 1 );
exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "ldbm" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an ldbm database\n", dbnum );
exit( 1 );
exit( EXIT_FAILURE );
}
slap_startup(dbnum);
@ -116,7 +116,7 @@ main( int argc, char **argv )
if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_NEWDB ))
== NULL ) {
perror( "id2entry file" );
exit( 1 );
exit( EXIT_FAILURE );
}
id = 0;
@ -180,7 +180,7 @@ main( int argc, char **argv )
LDBM_INSERT ) != 0 ) {
fputs("id2entry ldbm_store failed\n",
stderr);
exit( 1 );
exit( EXIT_FAILURE );
}
}
*buf = '\0';

View file

@ -21,7 +21,7 @@ static void
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-n databasenumber] attr\n", name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -72,7 +72,7 @@ main( int argc, char **argv )
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
exit( 1 );
exit( EXIT_FAILURE );
}
}
@ -88,15 +88,15 @@ main( int argc, char **argv )
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No bdb2 database found in config file\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
exit( 1 );
exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "bdb2" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an bdb2 database\n", dbnum );
exit( 1 );
exit( EXIT_FAILURE );
}
slap_startup(dbnum);
@ -109,7 +109,7 @@ main( int argc, char **argv )
bdb2i_attr_masks( be->be_private, attr, &indexmask, &syntaxmask );
if ( indexmask == 0 ) {
exit( 0 );
exit( EXIT_SUCCESS );
}
id = 0;
@ -172,5 +172,5 @@ main( int argc, char **argv )
slap_shutdown(dbnum);
slap_destroy();
exit( 0 );
exit( EXIT_SUCCESS );
}

View file

@ -21,7 +21,7 @@ static void
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-n databasenumber] attr\n", name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -74,7 +74,7 @@ main( int argc, char **argv )
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
exit( 1 );
exit( EXIT_FAILURE );
}
}
@ -90,15 +90,15 @@ main( int argc, char **argv )
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No ldbm database found in config file\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
exit( 1 );
exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "ldbm" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an ldbm database\n", dbnum );
exit( 1 );
exit( EXIT_FAILURE );
}
slap_startup(dbnum);
@ -111,7 +111,7 @@ main( int argc, char **argv )
attr_masks( be->be_private, attr, &indexmask, &syntaxmask );
if ( indexmask == 0 ) {
exit( 0 );
exit( EXIT_SUCCESS );
}
id = 0;

View file

@ -32,7 +32,7 @@ static void
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-j #jobs] [-n databasenumber] [-s sbindir]\n", name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -95,7 +95,7 @@ main( int argc, char **argv )
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
exit( 1 );
exit( EXIT_FAILURE );
}
}
@ -106,7 +106,7 @@ main( int argc, char **argv )
rc = slap_init(SLAP_TOOL_MODE, "ldif2ldbm");
if (rc != 0 ) {
fprintf( stderr, "ldif2ldbm: slap_init failed!\n");
exit(1);
exit(EXIT_FAILURE);
}
read_config( tailorfile );
@ -120,15 +120,15 @@ main( int argc, char **argv )
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No bdb2 database found in config file\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
exit( 1 );
exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "bdb2" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an bdb2 database\n", dbnum );
exit( 1 );
exit( EXIT_FAILURE );
}
slap_startup(dbnum);
@ -272,7 +272,7 @@ main( int argc, char **argv )
slap_destroy();
exit( 0 );
exit( EXIT_SUCCESS );
}
static void
@ -287,7 +287,7 @@ fork_child( char *prog, char *args[] )
execvp( prog, args );
fprintf( stderr, "%s: ", prog );
perror( "execv" );
exit( -1 );
exit( EXIT_FAILURE );
break;
case -1: /* trouble */

View file

@ -35,7 +35,7 @@ static void
usage( char *name )
{
fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-j #jobs] [-n databasenumber] [-s sbindir]\n", name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -101,7 +101,7 @@ main( int argc, char **argv )
} else {
if ( freopen( inputfile, "r", stdin ) == NULL ) {
perror( inputfile );
exit( 1 );
exit( EXIT_FAILURE );
}
}
@ -112,7 +112,7 @@ main( int argc, char **argv )
rc = slap_init(SLAP_TOOL_MODE, "ldif2ldbm");
if (rc != 0 ) {
fprintf( stderr, "ldif2ldbm: slap_init failed!\n");
exit(1);
exit(EXIT_FAILURE);
}
read_config( tailorfile );
@ -126,15 +126,15 @@ main( int argc, char **argv )
}
if ( dbnum == nbackends ) {
fprintf( stderr, "No ldbm database found in config file\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
exit( 1 );
exit( EXIT_FAILURE );
} else if ( strcasecmp( backends[dbnum].be_type, "ldbm" ) != 0 ) {
fprintf( stderr, "Database number %d selected via -n is not an ldbm database\n", dbnum );
exit( 1 );
exit( EXIT_FAILURE );
}
slap_startup(dbnum);
@ -315,7 +315,7 @@ fork_child( char *prog, char *args[] )
{
fprintf( stderr, "Could not create %s: ", prog );
perror( "CreateProcess" );
exit (-1);
exit (EXIT_FAILURE);
}
processes[nkids] = proc_info.hProcess;
@ -357,7 +357,7 @@ fork_child( char *prog, char *args[] )
execvp( prog, args );
fprintf( stderr, "%s: ", prog );
perror( "execv" );
exit( -1 );
exit( EXIT_FAILURE );
break;
case -1: /* trouble */

View file

@ -48,13 +48,13 @@ main( int argc, char **argv )
*/
if ( (ld = ldap_init( "vertigo:5555", 0 )) == NULL ) {
perror( "ldap_init" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( ldap_search( ld, "cn=index", LDAP_SCOPE_ONELEVEL, "(objectclass=*)",
attrs, 0 ) == -1 ) {
ldap_perror( ld, "ldap_search" );
exit( 1 );
exit( EXIT_FAILURE );
}
printf( "attr\tdn\tnentries\tvcount\tvsize\twcount\twsize\tpcount\tpsize\tscount\tssize\n" );
@ -82,7 +82,7 @@ main( int argc, char **argv )
DB_FLAGS, MODE, CACHE_SIZE )) == NULL || (sldbm = ldbm_open(
"scount.ldbm", DB_FLAGS, MODE, CACHE_SIZE )) == NULL ) {
perror( "ldbm_open" );
exit( 1 );
exit( EXIT_FAILURE );
}
vcount = 0; vsize = 0;
wcount = 0; wsize = 0;
@ -164,7 +164,7 @@ main( int argc, char **argv )
(void) unlink( "pcount.ldbm" );
(void) unlink( "scount.ldbm" );
exit( 0 );
exit( EXIT_SUCCESS );
}
static void

View file

@ -60,7 +60,7 @@ slap_init_user( char *user, char *group )
if ( pwd == NULL ) {
Debug( LDAP_DEBUG_ANY, "No passwd entry for user %s\n",
user, 0, 0 );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( got_uid ) {
free( user );
@ -93,7 +93,7 @@ slap_init_user( char *user, char *group )
if ( grp == NULL ) {
Debug( LDAP_DEBUG_ANY, "No group entry for group %s\n",
group, 0, 0 );
exit( 1 );
exit( EXIT_FAILURE );
}
}
free( group );
@ -104,7 +104,7 @@ slap_init_user( char *user, char *group )
if ( getuid() == 0 && initgroups( user, gid ) != 0 ) {
Debug( LDAP_DEBUG_ANY,
"Could not set the group access (gid) list\n", 0, 0, 0 );
exit( 1 );
exit( EXIT_FAILURE );
}
free( user );
}
@ -117,13 +117,13 @@ slap_init_user( char *user, char *group )
if ( setgid( gid ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "Could not set real group id to %d\n",
gid, 0, 0 );
exit( 1 );
exit( EXIT_FAILURE );
}
#ifdef HAVE_SETEGID
if ( setegid( gid ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "Could not set effective group id to %d\n",
gid, 0, 0 );
exit( 1 );
exit( EXIT_FAILURE );
}
#endif
}
@ -132,13 +132,13 @@ slap_init_user( char *user, char *group )
if ( setuid( uid ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "Could not set real user id to %d\n",
uid, 0, 0 );
exit( 1 );
exit( EXIT_FAILURE );
}
#ifdef HAVE_SETEUID
if ( seteuid( uid ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "Could not set effective user id to %d\n",
uid, 0, 0 );
exit( 1 );
exit( EXIT_FAILURE );
}
#endif
}

View file

@ -39,7 +39,7 @@ ch_malloc(
if ( (new = (void *) ber_memalloc( size )) == NULL ) {
fprintf( stderr, "malloc of %lu bytes failed\n",
(long) size );
exit( 1 );
exit( EXIT_FAILURE );
}
return( new );
@ -71,7 +71,7 @@ ch_realloc(
if ( (new = (void *) ber_memrealloc( block, size )) == NULL ) {
fprintf( stderr, "realloc of %lu bytes failed\n",
(long) size );
exit( 1 );
exit( EXIT_FAILURE );
}
return( new );
@ -95,7 +95,7 @@ ch_calloc(
if ( (new = (void *) ber_memcalloc( nelem, size )) == NULL ) {
fprintf( stderr, "calloc of %lu elems of %lu bytes failed\n",
(long) nelem, (long) size );
exit( 1 );
exit( EXIT_FAILURE );
}
return( new );

View file

@ -64,7 +64,7 @@ slurpd_read_config(
if ( (fp = fopen( fname, "r" )) == NULL ) {
perror( fname );
exit( 1 );
exit( EXIT_FAILURE );
}
lineno = 0;
@ -96,7 +96,7 @@ slurpd_read_config(
"line %d: missing filename in \"replogfile ",
lineno );
fprintf( stderr, "<filename>\" line\n" );
exit( 1 );
exit( EXIT_FAILURE );
} else if ( cargc > 2 && *cargv[2] != '#' ) {
fprintf( stderr,
"line %d: extra cruft at the end of \"replogfile %s\"",
@ -258,13 +258,13 @@ add_replica(
( nr + 1 ) * sizeof( Re * ));
if ( sglob->replicas == NULL ) {
fprintf( stderr, "out of memory, add_replica\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
sglob->replicas[ nr ] = NULL;
if ( Ri_init( &(sglob->replicas[ nr - 1 ])) < 0 ) {
fprintf( stderr, "out of memory, Ri_init\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( parse_replica_line( cargv, cargc,
sglob->replicas[ nr - 1] ) < 0 ) {
@ -287,7 +287,7 @@ add_replica(
sglob->replicas[ nr - 1 ] );
if ( sglob->replicas[ nr - 1]->ri_stel == NULL ) {
fprintf( stderr, "Failed to add status element structure\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
}
}
@ -367,7 +367,7 @@ parse_replica_line(
fprintf( stderr, "You must rebuild the LDAP release with\n" );
fprintf( stderr, "kerberos support if you wish to use\n" );
fprintf( stderr, "bindmethod=kerberos\n" );
exit( 1 );
exit( EXIT_FAILURE );
#endif /* HAVE_KERBEROS */
} else if ( !strcasecmp( val, SIMPLESTR )) {
ri->ri_bind_method = AUTH_SIMPLE;

View file

@ -59,12 +59,12 @@ init_globals( void )
g->srpos = 0L;
if ( St_init( &(g->st)) < 0 ) {
fprintf( stderr, "Cannot initialize status data\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
ldap_pvt_thread_mutex_init( &(g->rej_mutex) );
if ( Rq_init( &(g->rq)) < 0 ) {
fprintf( stderr, "Cannot initialize queue\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
#ifdef HAVE_KERBEROS
g->default_srvtab = SRVTAB;

View file

@ -47,14 +47,14 @@ main(
*/
if (( sglob = init_globals()) == NULL ) {
fprintf( stderr, "Out of memory initializing globals\n" );
exit( 1 );
exit( EXIT_FAILURE );
}
/*
* Process command-line args and fill in globals.
*/
if ( doargs( argc, argv, sglob ) < 0 ) {
exit( 1 );
exit( EXIT_FAILURE );
}
/*
@ -64,7 +64,7 @@ main(
fprintf( stderr,
"Errors encountered while processing config file \"%s\"\n",
sglob->slapd_configfile );
exit( 1 );
exit( EXIT_FAILURE );
}
/*
@ -73,7 +73,7 @@ main(
if ( sglob->st->st_read( sglob->st )) {
fprintf( stderr, "Malformed slurpd status file \"%s\"\n",
sglob->slurpd_status_file, 0, 0 );
exit( 1 );
exit( EXIT_FAILURE );
}
/*
@ -81,7 +81,7 @@ main(
* Check for any fatal error conditions before we get started
*/
if ( sanity() < 0 ) {
exit( 1 );
exit( EXIT_FAILURE );
}
/*
@ -110,7 +110,7 @@ main(
{
Debug( LDAP_DEBUG_ANY, "file manager ldap_pvt_thread_create failed\n",
0, 0, 0 );
exit( 1 );
exit( EXIT_FAILURE );
}

View file

@ -29,8 +29,7 @@
#endif
#include <sys/types.h>
#include "lber.h"
#include "ldap.h"
#include <ldap.h>
#define ldap_debug slurp_debug
#include "ldap_log.h"

View file

@ -14,8 +14,7 @@
#include <sys/param.h>
#endif
#include "lber.h"
#include "ldap.h"
#include <ldap.h>
#define LOOPS 100
@ -31,7 +30,7 @@ usage( char *name )
{
fprintf( stderr, "usage: %s [-h <host>] -p port -D <managerDN> -w <passwd> -f <addfile> [-l <loops>]\n",
name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -88,7 +87,7 @@ main( int argc, char **argv )
fprintf( stderr, "%s: invalid entry DN in file \"%s\".\n",
argv[0], filename );
exit( 1 );
exit( EXIT_FAILURE );
}
@ -96,13 +95,13 @@ main( int argc, char **argv )
fprintf( stderr, "%s: invalid attrs in file \"%s\".\n",
argv[0], filename );
exit( 1 );
exit( EXIT_FAILURE );
}
do_addel( host, port, manager, passwd, entry, attrs, loops );
exit( 0 );
exit( EXIT_SUCCESS );
}
@ -130,19 +129,19 @@ addmodifyop( LDAPMod ***pmodsp, int modop, char *attr, char *value, int vlen )
if (( pmods = (LDAPMod **)realloc( pmods, (i + 2) *
sizeof( LDAPMod * ))) == NULL ) {
perror( "realloc" );
exit( 1 );
exit( EXIT_FAILURE );
}
*pmodsp = pmods;
pmods[ i + 1 ] = NULL;
if (( pmods[ i ] = (LDAPMod *)calloc( 1, sizeof( LDAPMod )))
== NULL ) {
perror( "calloc" );
exit( 1 );
exit( EXIT_FAILURE );
}
pmods[ i ]->mod_op = modop;
if (( pmods[ i ]->mod_type = strdup( attr )) == NULL ) {
perror( "strdup" );
exit( 1 );
exit( EXIT_FAILURE );
}
}
@ -157,20 +156,20 @@ addmodifyop( LDAPMod ***pmodsp, int modop, char *attr, char *value, int vlen )
(struct berval **)ber_memrealloc( pmods[ i ]->mod_bvalues,
(j + 2) * sizeof( struct berval * ))) == NULL ) {
perror( "ber_realloc" );
exit( 1 );
exit( EXIT_FAILURE );
}
pmods[ i ]->mod_bvalues[ j + 1 ] = NULL;
if (( bvp = (struct berval *)ber_memalloc( sizeof( struct berval )))
== NULL ) {
perror( "malloc" );
exit( 1 );
exit( EXIT_FAILURE );
}
pmods[ i ]->mod_bvalues[ j ] = bvp;
bvp->bv_len = vlen;
if (( bvp->bv_val = (char *)malloc( vlen + 1 )) == NULL ) {
perror( "malloc" );
exit( 1 );
exit( EXIT_FAILURE );
}
SAFEMEMCPY( bvp->bv_val, value, vlen );
bvp->bv_val[ vlen ] = '\0';
@ -237,13 +236,13 @@ do_addel(
if (( ld = ldap_init( host, port )) == NULL ) {
perror( "ldap_init" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE )
!= LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_bind" );
exit( 1 );
exit( EXIT_FAILURE );
}

View file

@ -14,8 +14,7 @@
#include <sys/param.h>
#endif
#include "lber.h"
#include "ldap.h"
#include <ldap.h>
#define LOOPS 100
@ -27,7 +26,7 @@ usage( char *name )
{
fprintf( stderr, "usage: %s [-h <host>] -p port -e <entry> [-l <loops>]\n",
name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -70,13 +69,13 @@ main( int argc, char **argv )
fprintf( stderr, "%s: invalid EMPTY entry DN.\n",
argv[0] );
exit( 1 );
exit( EXIT_FAILURE );
}
do_read( host, port, entry, ( 4 * loops ));
exit( 0 );
exit( EXIT_SUCCESS );
}
@ -91,12 +90,12 @@ do_read( char *host, int port, char *entry, int maxloop )
if (( ld = ldap_init( host, port )) == NULL ) {
perror( "ldap_init" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( ldap_bind_s( ld, NULL, NULL, LDAP_AUTH_SIMPLE ) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_bind" );
exit( 1 );
exit( EXIT_FAILURE );
}

View file

@ -14,8 +14,7 @@
#include <sys/param.h>
#endif
#include "lber.h"
#include "ldap.h"
#include <ldap.h>
#define LOOPS 100
@ -27,7 +26,7 @@ usage( char *name )
{
fprintf( stderr, "usage: %s [-h <host>] -p port -b <searchbase> -f <searchfiter> [-l <loops>]\n",
name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -75,13 +74,13 @@ main( int argc, char **argv )
fprintf( stderr, "%s: invalid EMPTY search filter.\n",
argv[0] );
exit( 1 );
exit( EXIT_FAILURE );
}
do_search( host, port, sbase, filter, ( 4 * loops ));
exit( 0 );
exit( EXIT_SUCCESS );
}
@ -95,12 +94,12 @@ do_search( char *host, int port, char *sbase, char *filter, int maxloop )
if (( ld = ldap_init( host, port )) == NULL ) {
perror( "ldap_init" );
exit( 1 );
exit( EXIT_FAILURE );
}
if ( ldap_bind_s( ld, NULL, NULL, LDAP_AUTH_SIMPLE ) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_bind" );
exit( 1 );
exit( EXIT_FAILURE );
}

View file

@ -42,7 +42,7 @@ static void
usage( char *name )
{
fprintf( stderr, "usage: %s [-h <host>] -p <port> -D <manager> -w <passwd> -d <datadir> -b <baseDN> [-j <maxchild>] [-l <loops>] -P <progdir>\n", name );
exit( 1 );
exit( EXIT_FAILURE );
}
int
@ -130,7 +130,7 @@ main( int argc, char **argv )
fprintf( stderr, "%s: couldn't open data directory \"%s\".\n",
argv[0], dirname );
exit( 1 );
exit( EXIT_FAILURE );
}
@ -246,7 +246,7 @@ main( int argc, char **argv )
wait4kids( -1 );
exit( 0 );
exit( EXIT_SUCCESS );
}
static char *
@ -319,7 +319,7 @@ fork_child( char *prog, char *args[] )
execvp( prog, args );
fprintf( stderr, "%s: ", prog );
perror( "execv" );
exit( -1 );
exit( EXIT_FAILURE );
break;
case -1: /* trouble */