POV-Ray : Newsgroups : povray.programming : UNIX POVRay does not exit with failure on error : UNIX POVRay does not exit with failure on error Server Time
30 Jun 2024 13:06:54 EDT (-0400)
  UNIX POVRay does not exit with failure on error  
From: Wolfgang Wieser
Date: 11 Aug 2004 14:17:49
Message: <411a62cc@news.povray.org>
POVRay for UNIX does not exit with a non-zero exit status when an Error(..) 
occurs (such as during parsing). 

In order to fix that, the following patch is the easiest way I could come 
up with. Maybe not 100% clean (if exit codes can be >=999999): 

-----------<patch.diff>------------
diff -urN povray-3.6/unix/config.h povray-3.6-modified/unix/config.h
--- povray-3.6/unix/config.h    2004-07-18 12:16:27.000000000 +0200
+++ povray-3.6-modified/unix/config.h   2004-08-11 19:51:28.000000000 +0200
@@ -159,9 +159,9 @@
 /*
  * POVMS stuff.
  */
-#define POVRAY_BEGIN_COOPERATE  if(setjmp(globalSetJmpEnv) == 0) {
-#define POVRAY_END_COOPERATE    }
-#define EXIT_POVRAY(n)          longjmp(globalSetJmpEnv, 1)
+#define POVRAY_BEGIN_COOPERATE  int _rv=setjmp(globalSetJmpEnv); if(_rv==0) {
+#define POVRAY_END_COOPERATE    } else if(_rv!=1) throw (_rv-1000000);
+#define EXIT_POVRAY(n)          longjmp(globalSetJmpEnv, n ? (n+1000000) : 1)
 
 /*
  * Namespace.
--------------------------------------

Please consider fixing this in the next release. 

Wolfgang


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.