diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/smbd_shim.c | 16 | ||||
-rw-r--r-- | source3/lib/smbd_shim.h | 4 |
2 files changed, 20 insertions, 0 deletions
diff --git a/source3/lib/smbd_shim.c b/source3/lib/smbd_shim.c index 78a101c2a7..d5ad577975 100644 --- a/source3/lib/smbd_shim.c +++ b/source3/lib/smbd_shim.c @@ -98,3 +98,19 @@ void unbecome_root(void) } return; } + +void exit_server(const char *reason) +{ + if (shim.exit_server) { + shim.exit_server(reason); + } + exit(1); +} + +void exit_server_cleanly(const char *const reason) +{ + if (shim.exit_server_cleanly) { + shim.exit_server_cleanly(reason); + } + exit(0); +} diff --git a/source3/lib/smbd_shim.h b/source3/lib/smbd_shim.h index a51decc28c..1645837f36 100644 --- a/source3/lib/smbd_shim.h +++ b/source3/lib/smbd_shim.h @@ -46,6 +46,10 @@ struct smbd_shim void (*become_root)(void); void (*unbecome_root)(void); + + void (*exit_server)(const char *const explanation) _NORETURN_; + + void (*exit_server_cleanly)(const char *const explanation) _NORETURN_; }; void set_smbd_shim(const struct smbd_shim *shim_functions); |