captive_sandbox_parent_file_write(): Fixed .captivebug.xml.gz dumping.
authorshort <>
Wed, 29 Oct 2003 15:30:33 +0000 (15:30 +0000)
committershort <>
Wed, 29 Oct 2003 15:30:33 +0000 (15:30 +0000)
src/libcaptive/sandbox/parent-File.c

index e157816..7a960d7 100644 (file)
@@ -199,15 +199,16 @@ CaptiveVfsParentObject *captive_vfs_parent_object;
 
        *bytes_written_return=0;
 
-       if (captive_vfs_parent_object->corba_bug_action) {
-               xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_write",NULL);
-               xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
-               xmlNewProp(xml_action,"num_bytes",captive_printf_alloca("%lu",(unsigned long)num_bytes));
-               }
-
        r=captive_sandbox_parent_file_seek_slave(captive_file_parent_object,
                        GNOME_VFS_SEEK_START,captive_file_parent_object->offset);
        if (r==GNOME_VFS_OK) {
+
+               if (captive_vfs_parent_object->corba_bug_action) {
+                       xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_write",NULL);
+                       xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
+                       xmlNewProp(xml_action,"num_bytes",captive_printf_alloca("%lu",(unsigned long)num_bytes));
+                       }
+
                buffer_corba_local._maximum=num_bytes;
                buffer_corba_local._length=num_bytes;
                buffer_corba_local._buffer=(/* de-const */gpointer)buffer_captive;
@@ -216,9 +217,9 @@ CaptiveVfsParentObject *captive_vfs_parent_object;
                Captive_File_write(captive_file_parent_object->corba_File_object,
                                &buffer_corba_local,&bytes_written_corba,&captive_corba_ev);
                r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object);
+               if (xml_action)
+                       xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
                }
-       if (xml_action)
-               xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
        if (r!=GNOME_VFS_OK)
                return r;