summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-01-07 20:10:47 +0100
committerGünther Deschner <gd@samba.org>2008-01-07 20:13:40 +0100
commit74fc0bf9e5f4fe21b80a4b6df144d780e1bb943a (patch)
treecd98aea9f0e18b118871ed91203e5a1ad9a315ed
parentd6659f8ac84d5b3f19fb16a739657240f835c358 (diff)
downloadsamba-74fc0bf9e5f4fe21b80a4b6df144d780e1bb943a.tar.gz
samba-74fc0bf9e5f4fe21b80a4b6df144d780e1bb943a.tar.bz2
samba-74fc0bf9e5f4fe21b80a4b6df144d780e1bb943a.zip
In libnetapi example, use libnetapi_get_error_string().
Guenther (This used to be commit b624db92d61809a44881abbdd09dfa3a74ff7a88)
-rw-r--r--source3/lib/netapi/examples/netdomjoin/netdomjoin.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/lib/netapi/examples/netdomjoin/netdomjoin.c b/source3/lib/netapi/examples/netdomjoin/netdomjoin.c
index 634d265597..a0ac0b1e56 100644
--- a/source3/lib/netapi/examples/netdomjoin/netdomjoin.c
+++ b/source3/lib/netapi/examples/netdomjoin/netdomjoin.c
@@ -104,7 +104,12 @@ int main(int argc, char **argv)
password,
join_flags);
if (status != 0) {
- printf("Join failed with: %s\n", libnetapi_errstr(ctx, status));
+ const char *errstr = NULL;
+ errstr = libnetapi_get_error_string(ctx);
+ if (!errstr) {
+ errstr = libnetapi_errstr(ctx, status);
+ }
+ printf("Join failed with: %s\n", errstr);
} else {
printf("Successfully joined\n");
}