Using libsmbclient in 3-2-stable it looks like smbc_init_context always closes STDOUT the second time it is run. Below is modified version of the test code found in examples/libsmbclient/testctx.c ------------------------------------------------------------------------------------ #include <libsmbclient.h> #include <stdio.h> void create_and_destroy_context (void) { printf( "a\n" ); SMBCCTX *ctx; ctx = smbc_new_context (); printf( "b\n" ); smbc_init_context (ctx); printf( "c\n" ); smbc_free_context (ctx, 1); printf( "d\n" ); } int main (int argc, char **argv) { printf( "first\n" ); create_and_destroy_context (); printf( "second\n" ); create_and_destroy_context (); return 0; } ------------------------------------------------------------------------------------ $ /usr/local/samba/bin/smbclient --version Version 3.2.5 $ gcc test2.c -I/usr/local/samba/include -L/usr/local/samba/lib -lsmbclient $ ./a.out first a b c d second a b
to me
Fixed in branches v3-2-test and master. Derrell