Enlightenment CVS committal

Author  : onefang
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore


Modified Files:
        ecore_private.h ecore_signal.c ecore_exe.c 


Log Message:
Make sure that the Last Words of a dead exe are preserved for future 
generations.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_private.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- ecore_private.h     16 Dec 2005 01:09:52 -0000      1.25
+++ ecore_private.h     19 Dec 2005 05:07:58 -0000      1.26
@@ -152,13 +152,20 @@
    Ecore_Exe_Flags  flags;
    Ecore_Fd_Handler *write_fd_handler; /* the fd_handler to handle write to 
child - if this was used, or NULL if not */
    Ecore_Fd_Handler *read_fd_handler; /* the fd_handler to handle read from 
child - if this was used, or NULL if not */
-   void        *write_data_buf; /* a data buffer for data to write to the 
child - realloced as needed for more data and flushed when the fd handler says 
writes are possible */
+   void        *write_data_buf; /* a data buffer for data to write to the 
child - 
+                                 * realloced as needed for more data and 
flushed when the fd handler says writes are possible 
+                                */
    int          write_data_size; /* the size in bytes of the data buffer */
    int          write_data_offset; /* the offset in bytes in the data buffer */
    void        *read_data_buf; /* data read from the child awating delivery to 
an event */
    int          read_data_size; /* data read from child in bytes */
    int          child_fd_write;        /* fd to write TO to send data to the 
child */
    int          child_fd_read; /* fd to read FROM when child has sent us (the 
parent) data */
+   /* I thought a bit about wether or not their could be multiple exit events, 
then realised that since we 
+    * delete the exe on the first exit event, the answer is no.  On the other 
hand, STOPing an exe may trigger
+    * this, even though it has not truly exited.  Probably should investigate 
this further.
+    */
+   struct _Ecore_Event_Exe_Exit  *exit_event; /* Process exit event */
 };
 #endif
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_signal.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- ecore_signal.c      9 Nov 2005 13:59:03 -0000       1.18
+++ ecore_signal.c      19 Dec 2005 05:07:58 -0000      1.19
@@ -161,14 +161,8 @@
          {
             Ecore_Event_Exe_Exit *e;
             
-            /* FIXME: If this process is set to read from the child, DELAY
-             * the exe event until the pipe from the child dies and reports
-             * errors - THEN report and exe - so store this exe value in the
-             * ecore_exe struct waiting for the read fd to die then report
-             * final read data, THEN this exit event
-             *
-             * If this process is set respawn, respawn with a suitable backoff
-             * for those that need too much respawning. 
+            /* FIXME: If this process is set respawn, respawn with a suitable 
backoff
+             * period for those that need too much respawning. 
              */
             e = _ecore_event_exe_exit_new();
             if (e)
@@ -187,9 +181,12 @@
                  e->exe = _ecore_exe_find(pid);
                  
                  if (sigchld_info.si_signo)
-                   e->data = sigchld_info;
+                   e->data = sigchld_info; /* FIXME: I'm not sure, but maybe 
we should clone this.  I don't know if anybody uses it. */
                  
-                 _ecore_event_add(ECORE_EVENT_EXE_EXIT, e, 
+                  if ((e->exe) && (e->exe->flags & ECORE_EXE_PIPE_READ))
+                    e->exe->exit_event = e;   /* We want to report the Last 
Words of the exe, so delay this event. */
+                 else
+                    _ecore_event_add(ECORE_EVENT_EXE_EXIT, e, 
                                   _ecore_event_exe_exit_free, NULL);
               }
          }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_exe.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- ecore_exe.c 16 Dec 2005 03:36:16 -0000      1.24
+++ ecore_exe.c 19 Dec 2005 05:07:58 -0000      1.25
@@ -771,7 +771,16 @@
                              }
                        }
                     if (lost_exe)
-                        ecore_exe_terminate(exe);
+                       {
+                          if (exe->exit_event)
+                             {
+                                _ecore_event_add(ECORE_EVENT_EXE_EXIT, 
exe->exit_event, 
+                                                 _ecore_event_exe_exit_free, 
NULL);
+                                exe->exit_event = NULL;   /* Just being 
paranoid. */
+                             }
+                          else
+                              ecore_exe_terminate(exe);   /* FIXME: give this 
some deep thought later. */
+                        }
                     break;
                  }
            }




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to