You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/06/26 07:35:27 UTC
[lucy-commits] svn commit: r1139714 -
/incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.c
Author: marvin
Date: Sun Jun 26 05:35:26 2011
New Revision: 1139714
URL: http://svn.apache.org/viewvc?rev=1139714&view=rev
Log:
LUCY-162 Use shell to redirect Charmonizer stderr on Windows.
Modified:
incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.c
Modified: incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.c?rev=1139714&r1=1139713&r2=1139714&view=diff
==============================================================================
--- incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.c (original)
+++ incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.c Sun Jun 26 05:35:26 2011
@@ -205,18 +205,25 @@ OS_run_local(const char *arg1, ...) {
int
OS_run_quietly(const char *command) {
int retval = 1;
-
+#ifdef _WIN32
+ char pattern[] = "%s > NUL 2> NUL";
+ size_t size = sizeof(pattern) + strlen(command) + 10;
+ char *quiet_command = (char*)malloc(size);
+ sprintf(quiet_command, pattern, command);
+ retval = system(quiet_command);
+ free(quiet_command);
+#else
if (!charm_run_initialized) {
charm_run_initialized = true;
S_build_charm_run();
}
-
if (!charm_run_ok) {
retval = system(command);
}
else {
retval = OS_run_local("_charm_run ", command, NULL);
}
+#endif
return retval;
}