Gentoo Archives: gentoo-commits

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: dev-libs/openssl/files/
Date: Mon, 18 Feb 2019 14:52:01
Message-Id: 1550501337.4e3b0bb26cca7fe669caed9d69158c82e0738bba.haubi@gentoo
1 commit: 4e3b0bb26cca7fe669caed9d69158c82e0738bba
2 Author: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 18 12:20:00 2019 +0000
4 Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 18 14:48:57 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=4e3b0bb2
7
8 dev-libs/openssl: Cygwin wants setmode(0), not O_TEXT
9
10 In Cygwin, beyond the binary mode and the text mode there also is mode
11 zero, where the carriage return is created only for files opened on a
12 text mount point. Otherwise, Cygwin goes without the carriage return,
13 but O_TEXT would force the carriage return to be created.
14
15 Package-Manager: Portage-2.3.55.1-prefix, Repoman-2.3.12
16 Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>
17
18 .../files/openssl-1.1.1a-cygwin-binmode.patch | 38 +++++++++++++++-------
19 1 file changed, 27 insertions(+), 11 deletions(-)
20
21 diff --git a/dev-libs/openssl/files/openssl-1.1.1a-cygwin-binmode.patch b/dev-libs/openssl/files/openssl-1.1.1a-cygwin-binmode.patch
22 index 7ab2fd5065..ce9cc4975c 100644
23 --- a/dev-libs/openssl/files/openssl-1.1.1a-cygwin-binmode.patch
24 +++ b/dev-libs/openssl/files/openssl-1.1.1a-cygwin-binmode.patch
25 @@ -1,24 +1,40 @@
26 For the setmode(O_TEXT), not submitted upstream yet:
27 https://cygwin.com/ml/cygwin/2019-02/msg00150.html
28 -https://cygwin.com/ml/cygwin/2019-02/msg00190.html
29 +https://cygwin.com/ml/cygwin/2019-02/msg00280.html
30
31 For the chmod 644, accepted upstream:
32 https://github.com/openssl/openssl/pull/8226
33 --- openssl-1.1.1a/crypto/bio/bss_file.c.orig 2019-02-15 19:41:48.605378800 +0100
34 +++ openssl-1.1.1a/crypto/bio/bss_file.c 2019-02-15 19:42:53.136709200 +0100
35 -@@ -251,12 +251,6 @@
36 - } else
37 - _setmode(fd, _O_BINARY);
38 - }
39 --# elif defined(OPENSSL_SYS_WIN32_CYGWIN)
40 -- int fd = fileno((FILE *)ptr);
41 -- if (num & BIO_FP_TEXT)
42 +@@ -254,7 +254,7 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr)
43 + # elif defined(OPENSSL_SYS_WIN32_CYGWIN)
44 + int fd = fileno((FILE *)ptr);
45 + if (num & BIO_FP_TEXT)
46 - setmode(fd, O_TEXT);
47 -- else
48 -- setmode(fd, O_BINARY);
49 ++ setmode(fd, 0); /* do not force O_TEXT in Cygwin */
50 + else
51 + setmode(fd, O_BINARY);
52 # endif
53 +@@ -279,11 +279,15 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr)
54 + ret = 0;
55 + break;
56 }
57 - break;
58 +-# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32_CYGWIN)
59 ++# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS)
60 + if (!(num & BIO_FP_TEXT))
61 + OPENSSL_strlcat(p, "b", sizeof(p));
62 + else
63 + OPENSSL_strlcat(p, "t", sizeof(p));
64 ++# elif defined(OPENSSL_SYS_WIN32_CYGWIN)
65 ++ if (!(num & BIO_FP_TEXT))
66 ++ OPENSSL_strlcat(p, "b", sizeof(p));
67 ++ /* else do not force DOS text mode in Cygwin */
68 + # endif
69 + fp = openssl_fopen(ptr, p);
70 + if (fp == NULL) {
71 +--
72 +2.19.2
73 +
74 --- openssl-1.1.1a/Configurations/unix-Makefile.tmpl.orig 2019-02-15 19:47:36.464755100 +0100
75 +++ openssl-1.1.1a/Configurations/unix-Makefile.tmpl 2019-02-15 19:47:42.605379700 +0100
76 @@ -650,7 +650,7 @@