oaf bits ...



Hi Maciej,

	Just a few bits to cleanup oaf's debug mode, and some stuff. Just
out of interest, have the stable branch's changes all been ported to HEAD
oaf yet ?

	Regards,

		Michael.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/oaf/ChangeLog,v
retrieving revision 1.156
diff -u -r1.156 ChangeLog
--- ChangeLog	2001/06/21 10:07:24	1.156
+++ ChangeLog	2001/06/25 19:51:13
@@ -1,3 +1,18 @@
+2001-06-25  Michael Meeks  <michael ximian com>
+
+	* oafd/od-corba.c (od_dump_list): don't dump properties
+	containing a '-' they are most likely going to screw the
+	terminal.
+
+	* liboaf/oaf-fork-server.c (oaf_server_by_forking): add
+	more debug on failure case.
+
+	* liboaf/oaf-registration.c (rloc_file_lock): remove
+	redundant re-open.
+
+	* oafd/main.c (main): don't do strange things with
+	dev_null_fd in debug mode.
+
 2001-06-20  Michael Meeks  <michael ximian com>
 
 	* liboaf/Makefile.am: add orbit-idl dependency on idl.
Index: liboaf/oaf-fork-server.c
===================================================================
RCS file: /cvs/gnome/oaf/liboaf/oaf-fork-server.c,v
retrieving revision 1.2
diff -u -r1.2 oaf-fork-server.c
--- liboaf/oaf-fork-server.c	2001/05/15 19:53:15	1.2
+++ liboaf/oaf-fork-server.c	2001/06/25 19:51:13
@@ -140,7 +140,6 @@
                 sigprocmask (SIG_SETMASK, &omask, NULL);
 		errval = OAF_GeneralError__alloc ();
 		errval->description = CORBA_string_dup (_("Couldn't fork a new process"));
-
 		CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
 				     ex_OAF_GeneralError, errval);
 		return CORBA_OBJECT_NIL;
@@ -203,8 +202,10 @@
 				retval = CORBA_OBJECT_NIL;
 #ifdef OAF_DEBUG
 			if (ai.do_srv_output)
-				g_message ("Did string_to_object on %s",
-					   ai.iorbuf);
+				g_message ("Did string_to_object on %s = '%p' (%s)",
+					   ai.iorbuf, retval,
+                                           ev->_major == CORBA_NO_EXCEPTION?
+                                           "no-exception" : ev->_id);
 #endif
 		} else {
 			OAF_GeneralError *errval;
Index: liboaf/oaf-registration.c
===================================================================
RCS file: /cvs/gnome/oaf/liboaf/oaf-registration.c,v
retrieving revision 1.26
diff -u -r1.26 oaf-registration.c
--- liboaf/oaf-registration.c	2001/05/15 19:53:15	1.26
+++ liboaf/oaf-registration.c	2001/06/25 19:51:13
@@ -434,7 +434,6 @@
 			break;
 	}
 
-	lock_fd = open (fn, O_CREAT | O_RDONLY, 0700);
 	fcntl (lock_fd, F_SETFD, FD_CLOEXEC);
 
 	if (lock_fd >= 0) {
Index: oafd/main.c
===================================================================
RCS file: /cvs/gnome/oaf/oafd/main.c,v
retrieving revision 1.29
diff -u -r1.29 main.c
--- oafd/main.c	2001/06/15 02:01:04	1.29
+++ oafd/main.c	2001/06/25 19:51:14
@@ -97,7 +97,7 @@
 	FILE *fh;
 	struct sigaction sa;
         const char *oaf_debug_output;
-        int dev_null_fd;
+        int dev_null_fd = -1;
         
 	if (chdir ("/")) {
 		g_print ("Couldn't chdir() to '/' (why ?!!). Exiting.\n");
@@ -150,6 +150,7 @@
         }
 
 	orb = oaf_init (argc, argv);
+
 	ml = g_main_new (FALSE);
 
 	root_poa = (PortableServer_POA)
@@ -231,13 +232,15 @@
 	if (fh) {
 		fprintf (fh, "%s\n", ior);
 		fclose (fh);
-		if(ior_fd <= 2)
+		if(ior_fd <= 2 && dev_null_fd > 0)
 		  dup2 (dev_null_fd, ior_fd);
 	} else {
 		printf ("%s\n", ior);
 		fflush (stdout);
 	}
-	close (dev_null_fd);
+        if (dev_null_fd > 0) {
+	  close (dev_null_fd);
+        }
 	CORBA_free (ior);
 
 #ifdef OAF_DEBUG
Index: oafd/od-corba.c
===================================================================
RCS file: /cvs/gnome/oaf/oafd/od-corba.c,v
retrieving revision 1.31
diff -u -r1.31 od-corba.c
--- oafd/od-corba.c	2001/05/15 19:53:15	1.31
+++ oafd/od-corba.c	2001/06/25 19:51:14
@@ -163,10 +163,14 @@
 			OAF_Property *prop =
 				&(od->attr_servers._buffer[i].
 				  props._buffer[j]);
+                        if (strstr (prop->name, "-")) /* Translated, likely to
+                                                         be annoying garbage value */
+                                continue;
+
 			g_print ("    %s = ", prop->name);
 			switch (prop->v._d) {
 			case OAF_P_STRING:
-				g_print ("\"%s\"\n", prop->v._u.value_string);
+                                g_print ("\"%s\"\n", prop->v._u.value_string);
 				break;
 			case OAF_P_NUMBER:
 				g_print ("%f\n", prop->v._u.value_number);



-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]