svn commit: samba r23241 - in branches: SAMBA_3_0/source/smbd SAMBA_3_0_26/source/smbd

Jeremy Allison jra at samba.org
Wed May 30 20:45:22 GMT 2007


On Wed, May 30, 2007 at 01:41:39PM +0000, vlendec at samba.org wrote:
> 
> Log:
> In preparation for the cluster messaging import the parent smbd needs to
> respond to events.c style events.
> 
> Modified:
>    branches/SAMBA_3_0/source/smbd/server.c
>    branches/SAMBA_3_0_26/source/smbd/server.c
>  
> -		num = sys_select(maxfd+1,&lfds,NULL,NULL,
> +		event_add_to_select_args(smbd_event_context(), &now,
> +					 &r_fds, &w_fds, &idle_timeout,
> +					 &maxfd);
> +
> +		num = sys_select(maxfd+1,&r_fds,&w_fds,NULL,
>  				 timeval_is_zero(&idle_timeout) ?
>  				 NULL : &idle_timeout);
>  		
> +		run_events(smbd_event_context(), num, &r_fds, &w_fds);
> +
>  		if (num == -1 && errno == EINTR) {
>  			if (got_sig_term) {
>  				exit_server_cleanly(NULL);
> @@ -427,6 +436,10 @@
>  			continue;
>  		}

Volker, I think this patch is incorrect.

You are calling run_events() before doing the num ==-1 && errno == EINTR
check. Run events can make system calls that will change errno and
mean this check is no longer valid.

Also run_events has a return that needs to be checked.

Can you check this really carefully please, I think this
needs to be :

                num = sys_select(maxfd+1,&r_fds,&w_fds,NULL,
                                 timeval_is_zero(&idle_timeout) ?
                                 NULL : &idle_timeout);

                if (num == -1 && errno == EINTR) {
			....
			continue;
		}

		if (run_events(smbd_event_context(), num, &r_fds, &w_fds)) {
			continue;
		}

Jeremy.


More information about the samba-technical mailing list