int set_blocking(int fd, bool set);
void smb_msleep(unsigned int t);
NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx,
- struct event_context *ev_ctx,
- bool parent_longlived);
+ struct event_context *ev_ctx,
+ struct server_id id,
+ bool parent_longlived);
void *malloc_(size_t size);
void *memalign_array(size_t el_size, size_t align, unsigned int count);
void *calloc_array(size_t size, size_t nmemb);
NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx,
struct event_context *ev_ctx,
+ struct server_id id,
bool parent_longlived)
{
NTSTATUS status = NT_STATUS_OK;
* For clustering, we need to re-init our ctdbd connection after the
* fork
*/
- status = messaging_reinit(msg_ctx, procid_self());
+ status = messaging_reinit(msg_ctx, id);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("messaging_reinit() failed: %s\n",
nt_errstr(status)));
void start_async_dns(void)
{
int fd1[2], fd2[2];
+ NTSTATUS status;
CatchChild();
CatchSignal(SIGHUP, SIG_IGN);
CatchSignal(SIGTERM, sig_term);
- if (!NT_STATUS_IS_OK(reinit_after_fork(nmbd_messaging_context(),
- nmbd_event_context(), true))) {
+ status = reinit_after_fork(nmbd_messaging_context(),
+ nmbd_event_context(),
+ procid_self(), true);
+
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("reinit_after_fork() failed\n"));
smb_panic("reinit_after_fork() failed");
}
{ NULL }
};
TALLOC_CTX *frame = talloc_stackframe(); /* Setup tos. */
+ NTSTATUS status;
load_case_tables();
pidfile_create("nmbd");
- if (!NT_STATUS_IS_OK(reinit_after_fork(nmbd_messaging_context(),
- nmbd_event_context(), false))) {
+ status = reinit_after_fork(nmbd_messaging_context(),
+ nmbd_event_context(),
+ procid_self(), false);
+
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("reinit_after_fork() failed\n"));
exit(1);
}
{
int fds[2];
pid_t pid;
+ NTSTATUS status;
*pfd = -1;
close_all_print_db();
- if (!NT_STATUS_IS_OK(reinit_after_fork(server_messaging_context(),
- server_event_context(), true))) {
+ status = reinit_after_fork(server_messaging_context(),
+ server_event_context(), procid_self(),
+ true);
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("cups_pcap_load_async: reinit_after_fork() failed\n"));
smb_panic("cups_pcap_load_async: reinit_after_fork() failed");
}
if(background_lpq_updater_pid == 0) {
struct tevent_fd *fde;
int ret;
+ NTSTATUS status;
/* Child. */
DEBUG(5,("start_background_queue: background LPQ thread started\n"));
close(pause_pipe[0]);
pause_pipe[0] = -1;
- if (!NT_STATUS_IS_OK(reinit_after_fork(server_messaging_context(),
- server_event_context(),
- true))) {
+ status = reinit_after_fork(server_messaging_context(),
+ server_event_context(),
+ procid_self(), true);
+
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("reinit_after_fork() failed\n"));
smb_panic("reinit_after_fork() failed");
}
close(listener_pipe[0]);
status = reinit_after_fork(smbd_messaging_context(),
- smbd_event_context(), false);
+ smbd_event_context(),
+ procid_self(), false);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("reinit_after_fork failed: %s\n",
nt_errstr(status)));
s = NULL;
status = reinit_after_fork(smbd_messaging_context(),
- smbd_event_context(), true);
+ smbd_event_context(), procid_self(),
+ true);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,
NT_STATUS_TOO_MANY_OPENED_FILES)) {
};
struct smbd_parent_context *parent = NULL;
TALLOC_CTX *frame = talloc_stackframe(); /* Setup tos. */
+ NTSTATUS status;
smbd_init_globals();
if (is_daemon)
pidfile_create("smbd");
- if (!NT_STATUS_IS_OK(reinit_after_fork(smbd_messaging_context(),
- smbd_event_context(), false))) {
+ status = reinit_after_fork(smbd_messaging_context(),
+ smbd_event_context(),
+ procid_self(), false);
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("reinit_after_fork() failed\n"));
exit(1);
}
poptContext pc;
int opt;
TALLOC_CTX *frame = talloc_stackframe();
+ NTSTATUS status;
/* glibc (?) likes to print "User defined signal 1" and exit if a
SIGUSR[12] is received before a handler is installed */
* winbindd-specific resources we must free yet. JRA.
*/
- if (!NT_STATUS_IS_OK(reinit_after_fork(winbind_messaging_context(),
- winbind_event_context(),
- false))) {
+ status = reinit_after_fork(winbind_messaging_context(),
+ winbind_event_context(),
+ procid_self(), false);
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("reinit_after_fork() failed\n"));
exit(1);
}
{
struct winbindd_domain *domain;
struct winbindd_child *cl;
+ NTSTATUS status;
- if (!NT_STATUS_IS_OK(reinit_after_fork(winbind_messaging_context(),
- winbind_event_context(),
- true))) {
+ status = reinit_after_fork(winbind_messaging_context(),
+ winbind_event_context(),
+ procid_self(), true);
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("reinit_after_fork() failed\n"));
return false;
}