cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [patch 7.19.5] VMS Exit handling fixes.

From: John E. Malmberg <wb8tyw_at_qsl.net>
Date: Wed, 10 Jun 2009 08:56:47 -0500

Yang Tse wrote:
> 2009/6/10, John E. Malmberg wrote:
>
>> This patch against the 7.19.6-20090609 daily snapshot makes things work.
>>
>> [...]
>> +++ packages/vms/curlmsg_vms.h Tue Jun 9 01:27:48 2009
>> [...]
>> +++ src/main.c Tue Jun 9 23:56:29 2009
>> [...]
>> +++ src/os-specific.c Tue Jun 9 01:26:49 2009
>> [...]
>> +++ src/os-specific.c Tue Jun 9 01:26:49 2009
>> [...]
>
> The src/os-specific.c part is duplicated. Any chance there's something missing?

Yes. Revised patch attached that includes os-specific.h.

> And, wouldn't things get simpler, with less #ifdef's, if 'vms_show'
> was completely removed from curlmsg_vms.h?

Maybe. I am trying to remember why I did not end up doing that.

I think that the vms_show variable is only used in the main.c module.

Regards,
-John
wb8tyw_at_qsl.net
Personal Opinion Only

--- /src_root/curl-7.19.6-daily/packages/vms/curlmsg_vms.h Wed Sep 3 21:00:13 2008
+++ packages/vms/curlmsg_vms.h Tue Jun 9 01:27:48 2009
@@ -7,8 +7,16 @@
 /* */
 /* If you update CURLMSG.MSG make sure to update this file to match. */
 /* */
+
+/* The MODULE_OS_SPECIFC sections are only used by os-specific.c */
+/* And must not be public to other modules to prevent duplicate symbols */
+
+#ifdef MODULE_OS_SPECIFIC
+ int vms_show = 0;
 #include "curlmsg.h"
-int vms_show = 0;
+#else
+ extern int vms_show;
+#endif
 /*
 #define FAC_CURL 0xC01
 #define FAC_SYSTEM 0
@@ -20,10 +28,11 @@
 #define SEV_WARNING 0
 #define SEV_SUCCESS 1
 #define SEV_ERROR 2
-#define SEV_INFO 3
+#define SEV_INFO 3
 #define SEV_FATAL 4
 */
-long vms_cond[] =
+#ifdef MODULE_OS_SPECIFIC
+static const long vms_cond[] =
         {
         CURL_OK,
         CURL_UNSUPPORTED_PROTOCOL,
@@ -111,3 +120,4 @@
         CURLE_SSL_ISSUER_ERROR,
         CURL_CURL_LAST
         };
+#endif
--- /src_root/curl-7.19.6-daily/src/main.c Mon Jun 8 21:00:17 2009
+++ src/main.c Tue Jun 9 23:56:29 2009
@@ -114,10 +114,6 @@
 #include <netinet/tcp.h> /* for TCP_KEEPIDLE, TCP_KEEPINTVL */
 #endif
 
-#ifdef __VMS
-# include "curlmsg_vms.h"
-#endif
-
 #include "os-specific.h"
 
 /* The last #include file should be: */
--- /src_root/curl-7.19.6-daily/src/os-specific.c Fri Jun 5 11:14:50 2009
+++ src/os-specific.c Tue Jun 9 01:26:49 2009
@@ -25,7 +25,8 @@
 #include <curl/curl.h>
 
 #ifdef __VMS
-# include "curlmsg_vms.h"
+# define MODULE_OS_SPECIFIC 1
+ int vms_show;
 #endif
 
 #define ENABLE_CURLX_PRINTF
@@ -39,7 +40,10 @@
 
 #ifdef __VMS
 
-int vms_shell = -1;
+void decc$__posix_exit(int __status);
+void decc$exit(int __status);
+
+static int vms_shell = -1;
 
 /* VMS has a DCL shell and and also has Unix shells ported to it.
  * When curl is running under a Unix shell, we want it to be as much
--- /src_root/curl-7.19.6-daily/src/os-specific.h Fri Jun 5 11:14:50 2009
+++ src/os-specific.h Tue Jun 9 01:26:38 2009
@@ -25,16 +25,14 @@
 
 #ifdef __VMS
 
-extern int vms_shell;
-
-void decc$__posix_exit(int __status);
-void decc$exit(int __status);
-
 int is_vms_shell(void);
 void vms_special_exit(int code, int vms_show);
 
+
 #undef exit
 #define exit(__code) vms_special_exit((__code), (0))
+
+# include "curlmsg_vms.h"
 
 #endif /* __VMS */
 
Received on 2009-06-10