From 0c21d7279bf5833747f4106d2501d02766462794 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Wed, 16 Oct 2019 09:38:51 +0100 Subject: [PATCH] Restrict modules/graceful to non-windows build and shim the IsChild marker --- modules/graceful/cleanup.go | 2 ++ modules/graceful/graceful_windows.go | 11 +++++++++++ modules/graceful/net.go | 2 ++ modules/graceful/restart.go | 2 ++ modules/graceful/server.go | 2 ++ modules/graceful/server_hooks.go | 2 ++ modules/graceful/server_http.go | 2 ++ modules/graceful/server_signals.go | 2 ++ 8 files changed, 25 insertions(+) create mode 100644 modules/graceful/graceful_windows.go diff --git a/modules/graceful/cleanup.go b/modules/graceful/cleanup.go index 1de087a999179..84355a9a70a26 100644 --- a/modules/graceful/cleanup.go +++ b/modules/graceful/cleanup.go @@ -1,3 +1,5 @@ +// +build !windows + // Copyright 2019 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. diff --git a/modules/graceful/graceful_windows.go b/modules/graceful/graceful_windows.go new file mode 100644 index 0000000000000..753db87133a50 --- /dev/null +++ b/modules/graceful/graceful_windows.go @@ -0,0 +1,11 @@ +// +build windows + +// Copyright 2019 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. +// This code is heavily inspired by the archived gofacebook/gracenet/net.go handler + +package graceful + +// This file contains shims for windows builds +const IsChild = false diff --git a/modules/graceful/net.go b/modules/graceful/net.go index f2612e21bef98..af484641c6e58 100644 --- a/modules/graceful/net.go +++ b/modules/graceful/net.go @@ -1,3 +1,5 @@ +// +build !windows + // Copyright 2019 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. diff --git a/modules/graceful/restart.go b/modules/graceful/restart.go index 33b3c4d417b4a..5cba0581a56c7 100644 --- a/modules/graceful/restart.go +++ b/modules/graceful/restart.go @@ -1,3 +1,5 @@ +// +build !windows + // Copyright 2019 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. diff --git a/modules/graceful/server.go b/modules/graceful/server.go index efe8b264b313d..abe1b3d6d0887 100644 --- a/modules/graceful/server.go +++ b/modules/graceful/server.go @@ -1,3 +1,5 @@ +// +build !windows + // Copyright 2019 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. diff --git a/modules/graceful/server_hooks.go b/modules/graceful/server_hooks.go index a80d955556489..b8ca20ddf509f 100644 --- a/modules/graceful/server_hooks.go +++ b/modules/graceful/server_hooks.go @@ -1,3 +1,5 @@ +// +build !windows + // Copyright 2019 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. diff --git a/modules/graceful/server_http.go b/modules/graceful/server_http.go index 1052637d5e74a..446f0f55519f8 100644 --- a/modules/graceful/server_http.go +++ b/modules/graceful/server_http.go @@ -1,3 +1,5 @@ +// +build !windows + // Copyright 2019 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. diff --git a/modules/graceful/server_signals.go b/modules/graceful/server_signals.go index ea76b5509c739..d0013b77af052 100644 --- a/modules/graceful/server_signals.go +++ b/modules/graceful/server_signals.go @@ -1,3 +1,5 @@ +// +build !windows + // Copyright 2019 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file.