Return EXIT_FAILURE if result code is not success.

This commit is contained in:
Kurt Zeilenga 2002-03-11 00:25:20 +00:00
parent c488c6cdfa
commit 3a5c4e9e97
2 changed files with 4 additions and 4 deletions

View file

@ -101,7 +101,7 @@ main( int argc, char *argv[] )
LDAP *ld = NULL;
struct berval *bv = NULL;
int id, code;
int id, code = LDAP_OTHER;
LDAPMessage *res;
char *matcheddn = NULL, *text = NULL, **refs = NULL;
char *retoid = NULL;
@ -781,5 +781,5 @@ skip:
/* disconnect from server */
ldap_unbind (ld);
return EXIT_SUCCESS;
return code == LDAP_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE;
}

View file

@ -95,7 +95,7 @@ main( int argc, char *argv[] )
LDAP *ld = NULL;
struct berval *bv = NULL;
int id, code;
int id, code = LDAP_OTHER;
LDAPMessage *res;
char *matcheddn = NULL, *text = NULL, **refs = NULL;
char *retoid = NULL;
@ -714,5 +714,5 @@ skip:
/* disconnect from server */
ldap_unbind (ld);
return EXIT_SUCCESS;
return code == LDAP_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE;
}