summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2013-01-14 21:24:23 +0000
committerArthur de Jong <arthur@arthurdejong.org>2013-01-14 21:24:23 +0000
commitb5b6c48ff54edcbe6e43e3dbe412f9faf911ab3f (patch)
treec85d7c5165b6ee4c62ff4dc74e4b49608ea3c719 /tests
parent0a5ac8b614588f26e930c1337f1b24a00bba86f4 (diff)
check whether setnetgrent() returns int or void (for FreeBSD)
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1914 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'tests')
-rw-r--r--tests/lookup_netgroup.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/lookup_netgroup.c b/tests/lookup_netgroup.c
index 024de56..07fbfbb 100644
--- a/tests/lookup_netgroup.c
+++ b/tests/lookup_netgroup.c
@@ -1,7 +1,7 @@
/*
lookup_netgroup.c - simple lookup code for netgroups
- Copyright (C) 2012 Arthur de Jong
+ Copyright (C) 2012, 2013 Arthur de Jong
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -38,11 +38,15 @@ int main(int argc,char *argv[])
exit(EXIT_FAILURE);
}
/* start lookup */
+#ifdef SETNETGRENT_RETURNS_VOID
+ setnetgrent(argv[1]);
+#else /* not SETNETGRENT_RETURNS_VOID */
if (setnetgrent(argv[1]) != 0)
{
/* output nothing */
exit(EXIT_FAILURE);
}
+#endif /* not SETNETGRENT_RETURNS_VOID */
fprintf(stdout, "%-20s", argv[1]);
while (getnetgrent(&host, &user, &domain) != 0)
{