summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/ProcessUNIX.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-06-12 19:44:50 (GMT)
committerBrad King <brad.king@kitware.com>2009-06-12 19:44:50 (GMT)
commit219626a2be2cb10c5e765cba0adee4637ee1220b (patch)
tree941e10c3bc7bccbc05d1b3796bb48ec294cb80aa /Source/kwsys/ProcessUNIX.c
parent4a9dd4aad401c6310b4c546aa5442b7f684e7343 (diff)
downloadCMake-219626a2be2cb10c5e765cba0adee4637ee1220b.zip
CMake-219626a2be2cb10c5e765cba0adee4637ee1220b.tar.gz
CMake-219626a2be2cb10c5e765cba0adee4637ee1220b.tar.bz2
COMP: Do not compile VMS-specific code on non-VMS
This helps avoid fixing VMS-specific code for non-VMS compilers where it isn't needed anyway.
Diffstat (limited to 'Source/kwsys/ProcessUNIX.c')
-rw-r--r--Source/kwsys/ProcessUNIX.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index 845fd31..2d70fa3 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -176,7 +176,9 @@ static void kwsysProcessRestoreDefaultSignalHandlers(void);
static pid_t kwsysProcessFork(kwsysProcess* cp,
kwsysProcessCreateInformation* si);
static void kwsysProcessKill(pid_t process_id);
+#if defined(__VMS)
static int kwsysProcessSetVMSFeature(const char* name, int value);
+#endif
static int kwsysProcessesAdd(kwsysProcess* cp);
static void kwsysProcessesRemove(kwsysProcess* cp);
#if KWSYSPE_USE_SIGINFO
@@ -727,12 +729,14 @@ void kwsysProcess_Execute(kwsysProcess* cp)
return;
}
+#if defined(__VMS)
/* Make sure pipes behave like streams on VMS. */
if(!kwsysProcessSetVMSFeature("DECC$STREAM_PIPE", 1))
{
kwsysProcessCleanup(cp, 1);
return;
}
+#endif
/* Save the real working directory of this process and change to
the working directory for the child processes. This is needed
@@ -2309,6 +2313,7 @@ static void kwsysProcessExit(void)
}
/*--------------------------------------------------------------------------*/
+#if !defined(__VMS)
static pid_t kwsysProcessFork(kwsysProcess* cp,
kwsysProcessCreateInformation* si)
{
@@ -2363,6 +2368,7 @@ static pid_t kwsysProcessFork(kwsysProcess* cp,
return fork();
}
}
+#endif
/*--------------------------------------------------------------------------*/
/* We try to obtain process information by invoking the ps command.
@@ -2485,7 +2491,7 @@ static void kwsysProcessKill(pid_t process_id)
/*--------------------------------------------------------------------------*/
#if defined(__VMS)
-int decc$feature_get_index(char *name);
+int decc$feature_get_index(const char* name);
int decc$feature_set_value(int index, int mode, int value);
static int kwsysProcessSetVMSFeature(const char* name, int value)
{
@@ -2494,13 +2500,6 @@ static int kwsysProcessSetVMSFeature(const char* name, int value)
i = decc$feature_get_index(name);
return i >= 0 && (decc$feature_set_value(i, 1, value) >= 0 || errno == 0);
}
-#else
-static int kwsysProcessSetVMSFeature(const char* name, int value)
-{
- (void)name;
- (void)value;
- return 1;
-}
#endif
/*--------------------------------------------------------------------------*/