summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--config.h.W32.template2
-rw-r--r--configure.in19
-rw-r--r--job.c8
-rw-r--r--main.c7
-rw-r--r--w32/include/sub_proc.h2
-rw-r--r--w32/subproc/sub_proc.c2
7 files changed, 34 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index d765363..0a4c07d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-11-15 Paul Smith <psmith@gnu.org>
+
+ * main.c (main): Use %ld when printing DWORD values.
+ * job.c (new_job): Ditto.
+ * w32/include/sub_proc.h: Use const.
+ * w32/subproc/sub_proc.c (open_jobserver_semaphore): Use const.
+ Fixes Savannah bug #34830. Patches suggested by Ozkan Sezer.
+
+ * configure.in (MAKE_JOBSERVER): Enable jobserver on W32 systems.
+ * config.h.W32.template (MAKE_JOBSERVER): Ditto.
+
2011-11-14 Paul Smith <psmith@gnu.org>
* read.c (eval): parse_file_seq() might shorten the string due to
diff --git a/config.h.W32.template b/config.h.W32.template
index 9b4138e..03a4316 100644
--- a/config.h.W32.template
+++ b/config.h.W32.template
@@ -332,7 +332,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#define MAKE_HOST "Windows32"
/* Define this to enable job server support in GNU make. */
-/* #undef MAKE_JOBSERVER */
+#define MAKE_JOBSERVER 1
/* Define to 1 if your `struct nlist' has an `n_un' member. Obsolete, depend
on `HAVE_STRUCT_NLIST_N_UN_N_NAME */
diff --git a/configure.in b/configure.in
index a1e720b..31c528d 100644
--- a/configure.in
+++ b/configure.in
@@ -301,18 +301,21 @@ if test "$make_cv_sa_restart" != no; then
[Define to 1 if <signal.h> defines the SA_RESTART constant.])
fi
-# enable make_cv_sa_restart for OS/2 so that the jobserver will be enabled,
-# but do it after HAVE_SA_RESTART has been defined.
-case "$host_os" in
- os2*) make_cv_sa_restart=yes ;;
+# Only allow jobserver on systems that support it
+case "/$ac_cv_func_pipe/$ac_cv_func_sigaction/$make_cv_sa_restart/$has_wait_nohang/" in
+ */no/*) make_cv_job_server=no ;;
esac
-case "$ac_cv_func_pipe/$ac_cv_func_sigaction/$make_cv_sa_restart/$has_wait_nohang/$make_cv_job_server" in
- yes/yes/yes/yes/yes)
- AC_DEFINE(MAKE_JOBSERVER, 1,
- [Define to 1 to enable job server support in GNU make.]);;
+# Also supported on OS2 and W32
+case "$host_os" in
+ os2*|mingw32) make_cv_sa_restart=yes ;;
esac
+if test "$make_cv_job_server" != no; then
+ AC_DEFINE(MAKE_JOBSERVER, 1,
+ [Define to 1 to enable job server support in GNU make.])
+fi
+
# if we have both lstat() and readlink() then we can support symlink
# timechecks.
case "$ac_cv_func_lstat/$ac_cv_func_readlink" in
diff --git a/job.c b/job.c
index f359520..c5fe0bf 100644
--- a/job.c
+++ b/job.c
@@ -946,7 +946,7 @@ free_child (struct child *child)
if (! release_jobserver_semaphore())
{
DWORD err = GetLastError();
- fatal (NILF,_("release jobserver semaphore: (Error %d: %s)"),
+ fatal (NILF, _("release jobserver semaphore: (Error %ld: %s)"),
err, map_windows32_error_to_string(err));
}
@@ -1775,9 +1775,11 @@ new_job (struct file *file)
#endif
while (1)
{
- char token;
int got_token;
+#ifndef WINDOWS32
+ char token;
int saved_errno;
+#endif
DB (DB_JOBS, ("Need a job token; we %shave children\n",
children ? "" : "don't "));
@@ -1842,7 +1844,7 @@ new_job (struct file *file)
if (got_token < 0)
{
DWORD err = GetLastError();
- fatal (NILF,_("semaphore or child process wait: (Error %d: %s)"),
+ fatal (NILF, _("semaphore or child process wait: (Error %ld: %s)"),
err, map_windows32_error_to_string(err));
}
#else
diff --git a/main.c b/main.c
index 16957d4..86a89ad 100644
--- a/main.c
+++ b/main.c
@@ -36,6 +36,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
# include <io.h>
# include "pathstuff.h"
# include "sub_proc.h"
+# include "w32err.h"
#endif
#ifdef __EMX__
# include <sys/types.h>
@@ -988,7 +989,7 @@ main (int argc, char **argv, char **envp)
fatal_signal_mask = 0;
#define ADD_SIG(sig) fatal_signal_mask |= sigmask (sig)
#else
-#define ADD_SIG(sig) (void)sig /* Needed to avoid warnings in MSVC. */
+#define ADD_SIG(sig) (void)sig
#endif
#endif
@@ -1728,7 +1729,7 @@ main (int argc, char **argv, char **envp)
if (! open_jobserver_semaphore(cp))
{
DWORD err = GetLastError();
- fatal (NILF,_("internal error: unable to open jobserver semaphore `%s': (Error %d: %s)"),
+ fatal (NILF, _("internal error: unable to open jobserver semaphore `%s': (Error %ld: %s)"),
cp, err, map_windows32_error_to_string(err));
}
DB (DB_JOBS, (_("Jobserver client (semaphore %s)\n"), cp));
@@ -1804,7 +1805,7 @@ main (int argc, char **argv, char **envp)
if (! create_jobserver_semaphore(job_slots - 1))
{
DWORD err = GetLastError();
- fatal (NILF,_("creating jobserver semaphore: (Error %d: %s)"),
+ fatal (NILF, _("creating jobserver semaphore: (Error %ld: %s)"),
err, map_windows32_error_to_string(err));
}
#else
diff --git a/w32/include/sub_proc.h b/w32/include/sub_proc.h
index b61373d..389ddf5 100644
--- a/w32/include/sub_proc.h
+++ b/w32/include/sub_proc.h
@@ -58,7 +58,7 @@ EXTERN_DECL(int process_errcnt, (HANDLE proc));
EXTERN_DECL(void process_pipes, (HANDLE proc, int pipes[3]));
/* jobserver routines */
-EXTERN_DECL(int open_jobserver_semaphore, (char* name));
+EXTERN_DECL(int open_jobserver_semaphore, (const char* name));
EXTERN_DECL(int create_jobserver_semaphore, (int tokens));
EXTERN_DECL(void free_jobserver_semaphore, (VOID_DECL));
EXTERN_DECL(int acquire_jobserver_semaphore, (VOID_DECL));
diff --git a/w32/subproc/sub_proc.c b/w32/subproc/sub_proc.c
index 64185b3..b4dddbe 100644
--- a/w32/subproc/sub_proc.c
+++ b/w32/subproc/sub_proc.c
@@ -63,7 +63,7 @@ static char jobserver_semaphore_name[MAX_PATH + 1];
static HANDLE jobserver_semaphore = NULL;
/* Open existing jobserver semaphore */
-int open_jobserver_semaphore(char* name)
+int open_jobserver_semaphore(const char* name)
{
jobserver_semaphore = OpenSemaphore(
SEMAPHORE_ALL_ACCESS, // Semaphore access setting