Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/ChangeLog,v
retrieving revision 1.418
diff -u -p -r1.418 ChangeLog
--- ChangeLog	4 Sep 2006 11:33:54 -0000	1.418
+++ ChangeLog	12 Sep 2006 13:52:58 -0000
@@ -1,3 +1,10 @@
+2006-09-12  Matthew Barnes  <mbarnes@redhat.com>
+
+	Fixes #348888
+
+	* libedataserver/e-msgport.c:
+	Only create an EMsgPort pipe when the file descriptor is asked for.
+
 2006-09-04  Harish Krishnaswamy  <kharish@novell.com>
 
 	* NEWS, configure.in: Evolution-Data-Server 1.8.0
Index: libedataserver/e-msgport.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserver/e-msgport.c,v
retrieving revision 1.10
diff -u -p -r1.10 e-msgport.c
--- libedataserver/e-msgport.c	26 Jul 2006 18:12:08 -0000	1.10
+++ libedataserver/e-msgport.c	12 Sep 2006 13:53:02 -0000
@@ -537,9 +537,11 @@ EMsgPort *e_msgport_new(void)
 	e_dlist_init(&mp->queue);
 	mp->lock = g_mutex_new();
 	mp->cond = g_cond_new();
-	e_pipe (mp->pipe.pipe);
+	mp->pipe.fd.read = -1;
+	mp->pipe.fd.write = -1;
 #ifdef HAVE_NSS
-	e_prpipe (mp->prpipe.pipe);
+	mp->prpipe.fd.read = NULL;
+	mp->prpipe.fd.write = NULL;
 #endif
 	mp->condwait = 0;
 
@@ -566,13 +568,29 @@ void e_msgport_destroy(EMsgPort *mp)
 /* get a fd that can be used to wait on the port asynchronously */
 int e_msgport_fd(EMsgPort *mp)
 {
-	return mp->pipe.fd.read;
+	gint fd;
+
+	g_mutex_lock (mp->lock);
+	fd = mp->pipe.fd.read;
+	if (fd < 0 && e_pipe (mp->pipe.pipe) == 0)
+		fd = mp->pipe.fd.read;
+	g_mutex_unlock (mp->lock);
+
+	return fd;
 }
 
 #ifdef HAVE_NSS
 PRFileDesc *e_msgport_prfd(EMsgPort *mp)
 {
-	return mp->prpipe.fd.read;
+	PRFileDesc *prfd;
+
+	g_mutex_lock (mp->lock);
+	prfd = mp->prpipe.fd.read;
+	if (prfd == NULL && e_prpipe (mp->prpipe.pipe) == 0)
+		prfd = mp->prpipe.fd.read;
+	g_mutex_unlock (mp->lock);
+
+	return prfd;
 }
 #endif
 
