On 01/07/2010 12:52 PM, Nicolas Charles wrote:
Hi,
I've just moved my Cygwin version from 3.0.2 to 3.0.3, and the behavior
of the workdirectory changed.
The windows administrator is named 'slave', and for some reasons
cfengine now tries to use /home/slave/.cfagent rather than /var/cfengine.
sl...@windows /var/cfengine/inputs$ which cf-agent
/var/cfengine/bin/cf-agent
sl...@windows /var/cfengine/inputs$ cf-agent.exe -Kvf ./failsafe.cf
cf3 Cfengine - autonomous configuration engi
cf3 ----------------------------------------
cf3 Work directory is /home/slave/.cfagent
How can I switch back to /var/cfengine ?
Looking into this in the code, it seems that this detection is in a if
defined(CFCYG) block. Changing this to if defined(NT) (as the code was
in 3.0.2) make this work again.
CFCYG is used is one other place in the code (OS name detection).
Attached is a patch that replaces all references to CFCYG with NT, that
makes these two things work as in 3.0.2.
This may or may not be the way to go - is CFCYG supposed to be defined?
If so, how, or why is it not when we compile in cygwin?
Regards,
Jonathan
Index: src/sysinfo.c
===================================================================
--- src/sysinfo.c (revision 706)
+++ src/sysinfo.c (working copy)
@@ -1049,7 +1049,7 @@
#endif
-#ifdef CFCYG
+#ifdef NT
for (sp = VSYSNAME.sysname; *sp != '\0'; sp++)
{
@@ -1090,7 +1090,7 @@
NewScalar("sys","crontab","",cf_str);
-#endif /* CFCYG */
+#endif /* NT */
#ifdef MINGW
NewClass(CanonifyName(VSYSNAME.version)); // code name - e.g. Windows Vista
Index: src/selfdiagnostic.c
===================================================================
--- src/selfdiagnostic.c (revision 706)
+++ src/selfdiagnostic.c (working copy)
@@ -182,7 +182,7 @@
strcpy(CFWORKDIR,WORKDIR);
}
Debug("Setting CFWORKDIR=%s\n", CFWORKDIR);
-#elif defined(CFCYG)
+#elif defined(NT)
strcpy(CFWORKDIR,WORKDIR);
MapName(CFWORKDIR);
#else
Index: src/generic_agent.c
===================================================================
--- src/generic_agent.c (revision 706)
+++ src/generic_agent.c (working copy)
@@ -347,7 +347,7 @@
strcpy(CFWORKDIR,WORKDIR);
}
Debug("Setting CFWORKDIR=%s\n", CFWORKDIR);
-#elif defined(CFCYG)
+#elif defined(NT)
strcpy(CFWORKDIR,WORKDIR);
MapName(CFWORKDIR);
#else
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine