From f3d515f7f6e99e52dac30336d43411b0faf8ad0c Mon Sep 17 00:00:00 2001 From: Michael Haubenwallner Date: Thu, 2 Mar 2017 17:26:53 +0100 Subject: forkables: inline dll_list::forkables_supported And LONG fits better for shared_info member forkable_hardlink_support. --- winsup/cygwin/dlfcn.cc | 2 +- winsup/cygwin/dll_init.cc | 1 + winsup/cygwin/dll_init.h | 6 ++++-- winsup/cygwin/fork.cc | 1 + winsup/cygwin/forkable.cc | 8 +------- winsup/cygwin/shared_info.h | 4 ++-- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/winsup/cygwin/dlfcn.cc b/winsup/cygwin/dlfcn.cc index 7ef7dfd..c675a57 100644 --- a/winsup/cygwin/dlfcn.cc +++ b/winsup/cygwin/dlfcn.cc @@ -15,13 +15,13 @@ details. */ #include "path.h" #include "fhandler.h" #include "dtable.h" -#include "dll_init.h" #include "cygheap.h" #include "perprocess.h" #include "cygtls.h" #include "tls_pbuf.h" #include "ntdll.h" #include "shared_info.h" +#include "dll_init.h" #include "pathfinder.h" /* Dumb allocator using memory from tmp_pathbuf.w_get (). diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index 82b0656..4baa48d 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -8,6 +8,7 @@ details. */ #include "cygerrno.h" #include "perprocess.h" #include "sync.h" +#include "shared_info.h" #include "dll_init.h" #include "environ.h" #include "security.h" diff --git a/winsup/cygwin/dll_init.h b/winsup/cygwin/dll_init.h index 5c4cc0b..c4a133f 100644 --- a/winsup/cygwin/dll_init.h +++ b/winsup/cygwin/dll_init.h @@ -86,8 +86,10 @@ struct dll class dll_list { - /* forkables */ - bool forkables_supported (); + bool forkables_supported () + { + return cygwin_shared->forkable_hardlink_support >= 0; + } DWORD forkables_dirx_size; bool forkables_created; PWCHAR forkables_dirx_ntname; diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index d914e30..3e01e20 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -20,6 +20,7 @@ details. */ #include "child_info.h" #include "cygtls.h" #include "tls_pbuf.h" +#include "shared_info.h" #include "dll_init.h" #include "cygmalloc.h" #include "ntdll.h" diff --git a/winsup/cygwin/forkable.cc b/winsup/cygwin/forkable.cc index 05b2285..1e02a8a 100644 --- a/winsup/cygwin/forkable.cc +++ b/winsup/cygwin/forkable.cc @@ -10,7 +10,6 @@ details. */ #include "cygerrno.h" #include "perprocess.h" #include "sync.h" -#include "dll_init.h" #include "environ.h" #include "security.h" #include "path.h" @@ -19,6 +18,7 @@ details. */ #include "cygheap.h" #include "pinfo.h" #include "shared_info.h" +#include "dll_init.h" #include "child_info.h" #include "cygtls.h" #include "exception.h" @@ -501,12 +501,6 @@ dll::create_forkable () return false; } -bool -dll_list::forkables_supported () -{ - return cygwin_shared->forkable_hardlink_support >= 0; -} - /* return the number of characters necessary to store one forkable name */ size_t dll_list::forkable_ntnamesize (dll_type type, PCWCHAR fullntname, PCWCHAR modname) diff --git a/winsup/cygwin/shared_info.h b/winsup/cygwin/shared_info.h index 307306c..83a1fd1 100644 --- a/winsup/cygwin/shared_info.h +++ b/winsup/cygwin/shared_info.h @@ -33,7 +33,7 @@ public: /* Data accessible to all tasks */ -#define CURR_SHARED_MAGIC 0xc590e67eU +#define CURR_SHARED_MAGIC 0x9f33cc5dU #define USER_VERSION 1 @@ -51,7 +51,7 @@ class shared_info mtinfo mt; loadavginfo loadavg; LONG pid_src; - char forkable_hardlink_support; /* single byte access always is atomic */ + LONG forkable_hardlink_support; void initialize (); void init_obcaseinsensitive (); -- cgit v1.1