graveman-cvs
[Top][All Lists]
Advanced

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

[Graveman-cvs] Changes to graveman/current/src/tools.c


From: sylvain cresto
Subject: [Graveman-cvs] Changes to graveman/current/src/tools.c
Date: Mon, 07 Feb 2005 21:33:17 -0500

Index: graveman/current/src/tools.c
diff -u graveman/current/src/tools.c:1.6 graveman/current/src/tools.c:1.7
--- graveman/current/src/tools.c:1.6    Sat Feb  5 17:31:48 2005
+++ graveman/current/src/tools.c        Tue Feb  8 02:32:57 2005
@@ -316,6 +316,20 @@
   return dest;
 }
 
+/* fin d'un programme externe, on defini une erreur si il ne s'est pas terminé 
correctement */
+void exit_prog(gint Apid, GError **Aerror, gchar *Adefmsg)
+{
+  gint Lcmdstatus = 0;
+
+  waitpid(Apid, &Lcmdstatus, 0);
+
+  if ((WIFEXITED(Lcmdstatus) && WEXITSTATUS(Lcmdstatus)!=0) || 
(!(WIFEXITED(Lcmdstatus)))) {
+    if (Aerror && !*Aerror) {
+      g_set_error(Aerror, GRAVEMAN_ERROR, _ERR_UNKNOWN_ERROR, Adefmsg ? 
Adefmsg : _("Operation failed"));
+    }
+  }
+}
+
 
 /*
  * vim:et:ts=8:sts=2:sw=2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]