1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/source4/smbd
Douglas Bagnall c98bdf2494 smbd/service_stream: connection processing flag is not really bool
The warning is:

../source4/smbd/service_stream.c: In function ‘stream_io_handler’:
../source4/smbd/service_stream.c:94:18: warning: increment of a boolean expression [-Wbool-operation]
  conn->processing++;
                    ^~
../source4/smbd/service_stream.c💯18: warning: decrement of a boolean expression [-Wbool-operation]
  conn->processing--;
                    ^~

while the code in question looks like:

	conn->processing++;
	if (flags & TEVENT_FD_WRITE) {
		conn->ops->send_handler(conn, flags);
	} else if (flags & TEVENT_FD_READ) {
		conn->ops->recv_handler(conn, flags);
	}
	conn->processing--;

If this is never going to be nested, processing can be bool and the ++
and -- can be true/false assignments. But it seems possible that these
might be nested so it is better to go the other way.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Dec  1 00:28:05 CET 2016 on sn-devel-144
2016-12-01 00:28:05 +01:00
..
process_model.c Revert making public of the samba-module library. 2011-12-03 08:36:30 +01:00
process_model.h s4-server: cleanup allocation of process models 2010-11-03 10:40:52 +00:00
process_single.c s4-process_single: Use pid,task_id as cluster_id in process_single just like process_prefork 2013-01-26 16:13:04 +01:00
process_standard.c Rely on /dev/urandom 2015-10-13 04:25:38 +02:00
server.c s4/messaging: messaging_dgm_ref talloc hierarchy fix 2016-09-13 00:19:26 +02:00
service_named_pipe.c s4:server_named_pipe: make sure we use lower case pipe name 2016-06-24 14:09:01 +02:00
service_stream.c s4: messaging: Remove bool auto_remove parameter from imessaging_init(). 2016-07-23 06:04:11 +02:00
service_stream.h smbd/service_stream: connection processing flag is not really bool 2016-12-01 00:28:05 +01:00
service_task.c s4: messaging: Remove bool auto_remove parameter from imessaging_init(). 2016-07-23 06:04:11 +02:00
service_task.h server_id.idl: Bring server_id.idl in common 2011-06-09 12:40:08 +02:00
service.c dlist: remove unneeded type argument from DLIST_ADD_END() 2016-02-06 21:48:17 +01:00
service.h
wscript_build Remove unused and untested source4 ntptr and spoolss systems 2016-07-19 13:41:11 +02:00