diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-12-09 07:18:59 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-12-09 07:18:59 +0000 |
commit | adbd4300fdce5be0945dd27dfa7dee5e4206c80d (patch) | |
tree | 15f201d400de5d05a877c601d15bac7a5c55ed3d /source3 | |
parent | 1445184502c97d0a835410bd5044278d27e4b169 (diff) | |
download | samba-adbd4300fdce5be0945dd27dfa7dee5e4206c80d.tar.gz samba-adbd4300fdce5be0945dd27dfa7dee5e4206c80d.tar.bz2 samba-adbd4300fdce5be0945dd27dfa7dee5e4206c80d.zip |
set return value to total errors
(This used to be commit 4a7e1f6bb12e74effad83410c4b07683eaaa4617)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/torture/nsstest.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/torture/nsstest.c b/source3/torture/nsstest.c index b45a287dcc..a8cdae5e25 100644 --- a/source3/torture/nsstest.c +++ b/source3/torture/nsstest.c @@ -25,6 +25,7 @@ static char *so_path = "/lib/libnss_winbind.so"; static char *nss_name = "winbind"; static int nss_errno; static NSS_STATUS last_error; +static int total_errors; static void *find_fn(const char *name) { @@ -52,7 +53,7 @@ static void *find_fn(const char *name) static void report_nss_error(const char *who, NSS_STATUS status) { last_error = status; - + total_errors++; printf("ERROR %s: NSS_STATUS=%d %d (nss_errno=%d)\n", who, status, NSS_STATUS_SUCCESS, nss_errno); } @@ -352,21 +353,25 @@ static void nss_test_errors(void) pwd = getpwnam("nosuchname"); if (pwd || last_error != NSS_STATUS_NOTFOUND) { + total_errors++; printf("ERROR Non existant user gave error %d\n", last_error); } pwd = getpwuid(0xFFF0); if (pwd || last_error != NSS_STATUS_NOTFOUND) { + total_errors++; printf("ERROR Non existant uid gave error %d\n", last_error); } grp = getgrnam("nosuchgroup"); if (grp || last_error != NSS_STATUS_NOTFOUND) { + total_errors++; printf("ERROR Non existant group gave error %d\n", last_error); } grp = getgrgid(0xFFF0); if (grp || last_error != NSS_STATUS_NOTFOUND) { + total_errors++; printf("ERROR Non existant gid gave error %d\n", last_error); } } @@ -380,5 +385,7 @@ static void nss_test_errors(void) nss_test_groups(); nss_test_errors(); - return 0; + printf("total_errors=%d\n", total_errors); + + return total_errors; } |