From 3f60a9e995c851a1dff2439cb16407d86cde7754 Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Sun, 5 Apr 2020 19:18:09 +0200 Subject: tests: fix conflict between Cygwin/msys and Windows PIDs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add 65536 to Windows PIDs to allow Windows specific treatment by having disjunct ranges for Cygwin/msys and Windows PIDs. See also: - https://cygwin.com/git/?p=newlib-cygwin.git;a=commit; ↵ h=b5e1003722cb14235c4f166be72c09acdffc62ea - https://cygwin.com/git/?p=newlib-cygwin.git;a=commit; ↵ h=448cf5aa4b429d5a9cebf92a0da4ab4b5b6d23fe Replaces #5178 Closes #5188 --- tests/server/util.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/server') diff --git a/tests/server/util.c b/tests/server/util.c index 263f0cece..fa3d45118 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -269,6 +269,15 @@ int write_pidfile(const char *filename) logmsg("Couldn't write pid file: %s %s", filename, strerror(errno)); return 0; /* fail */ } +#if defined(WIN32) || defined(_WIN32) + /* store pid + 65536 to avoid conflict with Cygwin/msys PIDs, see also: + * - https://cygwin.com/git/?p=newlib-cygwin.git;a=commit; ↵ + * h=b5e1003722cb14235c4f166be72c09acdffc62ea + * - https://cygwin.com/git/?p=newlib-cygwin.git;a=commit; ↵ + * h=448cf5aa4b429d5a9cebf92a0da4ab4b5b6d23fe + */ + pid += 65536; +#endif fprintf(pidfile, "%ld\n", pid); fclose(pidfile); logmsg("Wrote pid %ld to %s", pid, filename); -- cgit v1.2.3