Преглед на файлове

HPCC-14428 Replace popen/pclose with _poen/_pclose on Windows
Also remove "extern COMPONENTSTATUS_API" in componentstatus.cpp

xwang2713 преди 9 години
родител
ревизия
89145c2390
променени са 2 файла, в които са добавени 10 реда и са изтрити 1 реда
  1. 1 1
      esp/services/ws_machine/componentstatus.cpp
  2. 9 0
      esp/services/ws_machine/ws_machineService.cpp

+ 1 - 1
esp/services/ws_machine/componentstatus.cpp

@@ -331,7 +331,7 @@ static CComponentStatusFactory *csFactory = NULL;
 
 static CriticalSection getComponentStatusSect;
 
-extern COMPONENTSTATUS_API IComponentStatusFactory* getComponentStatusFactory()
+IComponentStatusFactory* getComponentStatusFactory()
 {
     CriticalBlock block(getComponentStatusSect);
 

+ 9 - 0
esp/services/ws_machine/ws_machineService.cpp

@@ -1232,8 +1232,13 @@ int Cws_machineEx::invokeProgram(const char *command_line, StringBuffer& respons
         DBGLOG("command_line=<%s>", command_line);
     }
 #ifndef NO_CONNECTION_DEBUG
+#ifdef _WINDOWS
+    if( (fp = _popen( command_line, "r" )) == NULL )
+        return -1;
+#else
     if( (fp = popen( command_line, "r" )) == NULL )
         return -1;
+#endif
 #else
     if( (fp = fopen( "c:\\temp\\preflight_result.txt", "r" )) == NULL )
         return -1;
@@ -1252,7 +1257,11 @@ int Cws_machineEx::invokeProgram(const char *command_line, StringBuffer& respons
     }
     // Close pipe and print return value of CHKDSK.
 #ifndef NO_CONNECTION_DEBUG
+#ifdef _WINDOWS
+    return _pclose( fp );
+#else
     return pclose( fp );
+#endif
 #else
     return fclose( fp );
 #endif