Quesiton on samba_init_module

Jelmer Vernooij jelmer at samba.org
Mon Nov 11 04:11:00 MST 2013


On Mon, Nov 11, 2013 at 02:56:46AM -0800, sandeep nag wrote:
> I see a initialization function for samba module(init_samba_module), but
> not a exit function. I am opening a file in init function, where should I
> close it. Just worrying on, If I do not close it, It may lead to some
> inconsistencies.
There is no exit function per se, as modules are not unloaded. On some platforms,
you can use a DT_FINI function.

If you'd like to have a function run before Samba exits, you could possibly also use
the standard atexit() function.

Jelmer


More information about the samba-technical mailing list