Skip to content
Browse files

Merge pull request #1853 from kacfengine/windows

Fix 900+ acceptance tests on Windows
  • Loading branch information...
2 parents a5d561a + e3c7834 commit be8cd4f732b03d57e3f997df42c713ec9124b24b @ediosyncratic ediosyncratic committed Jul 18, 2014
Showing with 18 additions and 8 deletions.
  1. +11 −1 configure.ac
  2. +1 −1 libpromises/enterprise_stubs.c
  3. +1 −1 libpromises/generic_agent.c
  4. +1 −1 libpromises/pipes_unix.c
  5. +1 −1 libpromises/storage_tools.c
  6. +3 −3 libpromises/unix.c
View
12 configure.ac
@@ -171,6 +171,16 @@ AS_IF([test x"$enable_fhs" = xyes], [
AC_SUBST(projlibdir)
dnl ######################################################################
+dnl Platform specific compiler flags.
+dnl ######################################################################
+
+AS_CASE([${target_os}],
+ [mingw*],
+ # Disable printf format warnings, because our wrapper supports more
+ # flags than vanilla Windows version, so they are false positives.
+ [CFLAGS="$CFLAGS -Wno-format"])
+
+dnl ######################################################################
dnl Enable debugging
dnl ######################################################################
@@ -855,7 +865,7 @@ AC_EGREP_CPP([primacros_found],
],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
- AC_MSG_RESULT(Unable to find out how to print intmax_t/uintmax_t types)])
+ AC_MSG_RESULT(Unable to find out how to scan intmax_t/uintmax_t types)])
HW_FUNC_VSNPRINTF
HW_FUNC_SNPRINTF
View
2 libpromises/enterprise_stubs.c
@@ -120,7 +120,7 @@ ENTERPRISE_VOID_FUNC_2ARG_DEFINE_STUB(void, LogTotalCompliance, const char *, ve
}
else
{
- fprintf(fout, "%" PRIdMAX ",%" PRIdMAX ": %s\n", (intmax_t)CFSTARTTIME, (intmax_t)time(NULL), string);
+ fprintf(fout, "%jd,%jd: %s\n", (intmax_t)CFSTARTTIME, (intmax_t)time(NULL), string);
fclose(fout);
}
}
View
2 libpromises/generic_agent.c
@@ -1304,7 +1304,7 @@ void WritePID(char *filename)
return;
}
- fprintf(fp, "%" PRIuMAX "\n", (uintmax_t)getpid());
+ fprintf(fp, "%ju\n", (uintmax_t)getpid());
fclose(fp);
}
View
2 libpromises/pipes_unix.c
@@ -535,7 +535,7 @@ static int cf_pwait(pid_t pid)
{
int status;
- Log(LOG_LEVEL_DEBUG, "cf_pwait - Waiting for process %" PRIdMAX, (intmax_t)pid);
+ Log(LOG_LEVEL_DEBUG, "cf_pwait - Waiting for process %jd", (intmax_t)pid);
while (waitpid(pid, &status, 0) < 0)
{
View
2 libpromises/storage_tools.c
@@ -93,7 +93,7 @@ off_t GetDiskUsage(char *file, CfSize type)
capacity = (double) (avail) / (double) (avail + used) * 100;
- Log(LOG_LEVEL_DEBUG, "GetDiskUsage(%s) = %" PRIdMAX "/%" PRIdMAX, file, (intmax_t) avail, (intmax_t) capacity);
+ Log(LOG_LEVEL_DEBUG, "GetDiskUsage(%s) = %jd/%jd", file, (intmax_t) avail, (intmax_t) capacity);
if (type == CF_SIZE_ABS)
{
View
6 libpromises/unix.c
@@ -43,7 +43,7 @@ void ProcessSignalTerminate(pid_t pid)
if(kill(pid, SIGINT) == -1)
{
- Log(LOG_LEVEL_ERR, "Could not send SIGINT to pid '%" PRIdMAX "'. (kill: %s)",
+ Log(LOG_LEVEL_ERR, "Could not send SIGINT to pid '%jd'. (kill: %s)",
(intmax_t)pid, GetErrorStr());
}
@@ -52,7 +52,7 @@ void ProcessSignalTerminate(pid_t pid)
if(kill(pid, SIGTERM) == -1)
{
- Log(LOG_LEVEL_ERR, "Could not send SIGTERM to pid '%" PRIdMAX "'. (kill: %s)",
+ Log(LOG_LEVEL_ERR, "Could not send SIGTERM to pid '%jd'. (kill: %s)",
(intmax_t)pid, GetErrorStr());
}
@@ -61,7 +61,7 @@ void ProcessSignalTerminate(pid_t pid)
if(kill(pid, SIGKILL) == -1)
{
- Log(LOG_LEVEL_ERR, "Could not send SIGKILL to pid '%" PRIdMAX "'. (kill: %s)",
+ Log(LOG_LEVEL_ERR, "Could not send SIGKILL to pid '%jd'. (kill: %s)",
(intmax_t)pid, GetErrorStr());
}

0 comments on commit be8cd4f

Please sign in to comment.
Something went wrong with that request. Please try again.