/[graveman]/graveman/current/src/tools.c
ViewVC logotype

Diff of /graveman/current/src/tools.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by scresto, Sat Feb 12 22:28:29 2005 UTC revision 1.12 by scresto, Tue Feb 15 22:44:44 2005 UTC
# Line 317  gchar * sc_strescape (const gchar *sourc Line 317  gchar * sc_strescape (const gchar *sourc
317  }  }
318    
319  /* fin d'un programme externe, on defini une erreur si il ne s'est pas terminé correctement */  /* fin d'un programme externe, on defini une erreur si il ne s'est pas terminé correctement */
320  void exit_prog(gint Apid, GError **Aerror, gchar *Adefmsg)  void exit_prog(gint Apid, gboolean Aabort, GError **Aerror, gchar *Adefmsg)
321  {  {
322    gint Lcmdstatus = 0;    gint Lcmdstatus = 0;
323    
324    kill(Apid, SIGTERM);    if (Aabort) kill(Apid, SIGTERM);
325    waitpid(Apid, &Lcmdstatus, 0);    waitpid(Apid, &Lcmdstatus, 0);
   
326    if ((WIFEXITED(Lcmdstatus) && WEXITSTATUS(Lcmdstatus)!=0) || (!(WIFEXITED(Lcmdstatus)))) {    if ((WIFEXITED(Lcmdstatus) && WEXITSTATUS(Lcmdstatus)!=0) || (!(WIFEXITED(Lcmdstatus)))) {
327        _DEB("oui une erreur\n");
328      if (Aerror && !*Aerror) {      if (Aerror && !*Aerror) {
329        g_set_error(Aerror, GRAVEMAN_ERROR, _ERR_UNKNOWN_ERROR, Adefmsg ? Adefmsg : _("Operation failed"));        g_set_error(Aerror, GRAVEMAN_ERROR, _ERR_UNKNOWN_ERROR, Adefmsg ? Adefmsg : _("Operation failed"));
330      }      }

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26