From 06bbe82148b16dfec13e08ba9f49df393f6af499 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 21 Jun 2019 13:11:52 +0000 Subject: [PATCH] unix: correctly rename Val member in Sigset_t on freebsd The generated name X__bits should be changed to Val to match the type on Linux. This was done manually in CL 179099 when Sigset_t was added for freebsd. Modify mkpost.go to do it, so future changes won't revert the rename. Change-Id: I0ce135cbd8d03648a1576244d9c977b39c8f5889 Reviewed-on: https://go-review.googlesource.com/c/sys/+/183220 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- unix/mkpost.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/mkpost.go b/unix/mkpost.go index 4d5b531b..eb433205 100644 --- a/unix/mkpost.go +++ b/unix/mkpost.go @@ -50,8 +50,8 @@ func main() { } // Intentionally export __val fields in Fsid and Sigset_t - valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__val(\s+\S+\s+)}`) - b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$3}")) + valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__(bits|val)(\s+\S+\s+)}`) + b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$4}")) // Intentionally export __fds_bits field in FdSet fdSetRegex := regexp.MustCompile(`type (FdSet) struct {(\s+)X__fds_bits(\s+\S+\s+)}`)