+vfs_commit() logging to --bug-pathname file
authorshort <>
Wed, 16 Jul 2003 18:58:58 +0000 (18:58 +0000)
committershort <>
Wed, 16 Jul 2003 18:58:58 +0000 (18:58 +0000)
src/libcaptive/sandbox/parent-Vfs.c

index a080794..9ae5785 100644 (file)
 #include <time.h>
 #include <errno.h>
 #include <fcntl.h>
+#include "captive/macros.h"
 
 
-GnomeVFSResult captive_sandbox_parent_vfs_new(CaptiveVfsObject *captive_vfs_object)
+static GnomeVFSResult captive_sandbox_parent_vfs_new_silent(CaptiveVfsObject *captive_vfs_object)
 {
 gboolean errbool;
 
@@ -50,6 +51,25 @@ gboolean errbool;
 }
 
 
+GnomeVFSResult captive_sandbox_parent_vfs_new(CaptiveVfsObject *captive_vfs_object)
+{
+GnomeVFSResult r;
+
+       g_return_val_if_fail(captive_vfs_object!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
+
+       r=captive_sandbox_parent_vfs_new_silent(captive_vfs_object);
+
+       if (captive_vfs_object->corba_bug_action) {
+xmlNode *xml_action;
+
+               xml_action=xmlNewTextChild(captive_vfs_object->corba_bug_action,NULL,"vfs_new",NULL);
+               xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_vfs_object));
+               }
+
+       return r;
+}
+
+
 static void bug_doc_generate(CaptiveVfsObject *captive_vfs_object)
 {
 size_t out_fname_size;
@@ -78,7 +98,7 @@ int errint;
 }
 
 
-GnomeVFSResult captive_sandbox_parent_vfs_close(CaptiveVfsObject *captive_vfs_object)
+static GnomeVFSResult captive_sandbox_parent_vfs_close_silent(CaptiveVfsObject *captive_vfs_object)
 {
 GnomeVFSResult r;
 int errint;
@@ -165,14 +185,42 @@ GIOStatus erriostatus;
 }
 
 
+GnomeVFSResult captive_sandbox_parent_vfs_close(CaptiveVfsObject *captive_vfs_object)
+{
+       g_return_val_if_fail(captive_vfs_object!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
+
+       if (captive_vfs_object->corba_bug_action) {
+xmlNode *xml_action;
+
+               xml_action=xmlNewTextChild(captive_vfs_object->corba_bug_action,NULL,"vfs_close",NULL);
+               xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_vfs_object));
+               }
+
+       return captive_sandbox_parent_vfs_close_silent(captive_vfs_object);
+}
+
+
 GnomeVFSResult captive_sandbox_parent_vfs_commit(CaptiveVfsObject *captive_vfs_object)
 {
 GnomeVFSResult r_close,r_new;
+xmlNode *xml_action=NULL;
 
        g_return_val_if_fail(captive_vfs_object!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
 
-       r_close=captive_sandbox_parent_vfs_close(captive_vfs_object);   /* errors ignored */
-       r_new=captive_sandbox_parent_vfs_new(captive_vfs_object);
+       if (captive_vfs_object->corba_bug_action) {
+               xmlNewTextChild(captive_vfs_object->corba_bug_action,NULL,"vfs_commit",NULL);
+               xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_vfs_object));
+               }
+
+       r_close=captive_sandbox_parent_vfs_close_silent(captive_vfs_object);    /* errors ignored */
+       r_new=captive_sandbox_parent_vfs_new_silent(captive_vfs_object);
+
+       if (captive_vfs_object->corba_bug_action) {
+               xml_action=xmlNewTextChild(captive_vfs_object->corba_bug_action,NULL,"vfs_commit",NULL);
+               xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_vfs_object));
+               xmlNewProp(xml_action,"result_prev_close",gnome_vfs_result_to_string(r_close));
+               xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r_new));
+               }
 
        return (r_new!=GNOME_VFS_OK ? r_new : r_close);
 }