svn commit: samba r12123 - in branches/SAMBA_4_0/source: gtk/common lib/events

metze at samba.org metze at samba.org
Thu Dec 8 08:32:00 GMT 2005


Author: metze
Date: 2005-12-08 08:31:59 +0000 (Thu, 08 Dec 2005)
New Revision: 12123

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12123

Log:
handle fde == NULL at the correct level

metze
Modified:
   branches/SAMBA_4_0/source/gtk/common/gtk_events.c
   branches/SAMBA_4_0/source/lib/events/events.c
   branches/SAMBA_4_0/source/lib/events/events_liboop.c
   branches/SAMBA_4_0/source/lib/events/events_standard.c


Changeset:
Modified: branches/SAMBA_4_0/source/gtk/common/gtk_events.c
===================================================================
--- branches/SAMBA_4_0/source/gtk/common/gtk_events.c	2005-12-08 07:52:52 UTC (rev 12122)
+++ branches/SAMBA_4_0/source/gtk/common/gtk_events.c	2005-12-08 08:31:59 UTC (rev 12123)
@@ -171,8 +171,6 @@
 */
 static uint16_t gtk_event_get_fd_flags(struct fd_event *fde)
 {
-	if (!fde) return 0;
-
 	return fde->flags;
 }
 
@@ -185,8 +183,6 @@
 						      struct gtk_fd_event);
 	GIOCondition condition = 0;
 
-	if (!fde) return;
-
 	if (fde->flags == flags) return;
 
 	if (flags & EVENT_FD_READ)

Modified: branches/SAMBA_4_0/source/lib/events/events.c
===================================================================
--- branches/SAMBA_4_0/source/lib/events/events.c	2005-12-08 07:52:52 UTC (rev 12122)
+++ branches/SAMBA_4_0/source/lib/events/events.c	2005-12-08 08:31:59 UTC (rev 12123)
@@ -115,6 +115,7 @@
 */
 uint16_t event_get_fd_flags(struct fd_event *fde)
 {
+	if (!fde) return 0;
 	return fde->event_ctx->ops->get_fd_flags(fde);
 }
 
@@ -123,6 +124,7 @@
 */
 void event_set_fd_flags(struct fd_event *fde, uint16_t flags)
 {
+	if (!fde) return;
 	fde->event_ctx->ops->set_fd_flags(fde, flags);
 }
 

Modified: branches/SAMBA_4_0/source/lib/events/events_liboop.c
===================================================================
--- branches/SAMBA_4_0/source/lib/events/events_liboop.c	2005-12-08 07:52:52 UTC (rev 12122)
+++ branches/SAMBA_4_0/source/lib/events/events_liboop.c	2005-12-08 08:31:59 UTC (rev 12123)
@@ -20,7 +20,8 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-/* NOTE: this code compiles fine, but is completly *UNTESTED*
+/* 
+NOTE: this code compiles fine, but is completly *UNTESTED*
          and is only commited as example
 */
 
@@ -30,6 +31,15 @@
 
 #include <oop.h>
 
+/*
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
+
+ NOTE: this code compiles fine, but is completly *UNTESTED*
+       and is only commited as example
+
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!	 
+*/
+
 static int oop_event_context_destructor(void *ptr)
 {
 	struct event_context *ev = talloc_get_type(ptr, struct event_context);
@@ -139,8 +149,6 @@
 */
 static uint16_t oop_event_get_fd_flags(struct fd_event *fde)
 {
-	if (!fde) return 0;
-
 	return fde->flags;
 }
 
@@ -152,8 +160,6 @@
 	oop_source_sys *oop_sys;
 	oop_source *oop;
 
-	if (!fde) return;
-
 	oop_sys = fde->event_ctx->additional_data;
 	oop = oop_sys_source(oop_sys);
 

Modified: branches/SAMBA_4_0/source/lib/events/events_standard.c
===================================================================
--- branches/SAMBA_4_0/source/lib/events/events_standard.c	2005-12-08 07:52:52 UTC (rev 12122)
+++ branches/SAMBA_4_0/source/lib/events/events_standard.c	2005-12-08 08:31:59 UTC (rev 12123)
@@ -240,7 +240,7 @@
 */
 static uint16_t std_event_get_fd_flags(struct fd_event *fde)
 {
-	return fde?fde->flags:0;
+	return fde->flags;
 }
 
 /*
@@ -251,8 +251,7 @@
 #if WITH_EPOLL
 	struct event_context *ev;
 	struct std_event_context *std_ev;
-	if (fde == NULL || 
-	    fde->flags == flags) {
+	if (fde->flags == flags) {
 		return;
 	}
 	ev = fde->event_ctx;
@@ -267,9 +266,7 @@
 		}
 	}
 #endif
-	if (fde) {
-		fde->flags = flags;
-	}
+	fde->flags = flags;
 }
 
 /*



More information about the samba-cvs mailing list