diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-11-26 16:11:44 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2022-08-29 17:53:45 +0100 |
commit | f1d7ef46f77ff0145b3923effe4c71b67072731d (patch) | |
tree | 6a7e87470257f35ff0d5b45dffe7b19304fe8e5c /winsup/testsuite | |
parent | 19b3b814bcba422fa468530a441c0001361aed3c (diff) | |
download | newlib-f1d7ef46f77ff0145b3923effe4c71b67072731d.zip newlib-f1d7ef46f77ff0145b3923effe4c71b67072731d.tar.gz newlib-f1d7ef46f77ff0145b3923effe4c71b67072731d.tar.bz2 |
Cygwin: testsuite: Fix size of write to temporary file to be mmap()ed
See ltp commit 91361378
Diffstat (limited to 'winsup/testsuite')
-rw-r--r-- | winsup/testsuite/winsup.api/ltp/mmap02.c | 2 | ||||
-rw-r--r-- | winsup/testsuite/winsup.api/ltp/mmap03.c | 2 | ||||
-rw-r--r-- | winsup/testsuite/winsup.api/ltp/mmap04.c | 2 | ||||
-rw-r--r-- | winsup/testsuite/winsup.api/ltp/mmap05.c | 3 | ||||
-rw-r--r-- | winsup/testsuite/winsup.api/ltp/mmap06.c | 2 | ||||
-rw-r--r-- | winsup/testsuite/winsup.api/ltp/mmap07.c | 2 |
6 files changed, 6 insertions, 7 deletions
diff --git a/winsup/testsuite/winsup.api/ltp/mmap02.c b/winsup/testsuite/winsup.api/ltp/mmap02.c index 33a1273..b96bdb4 100644 --- a/winsup/testsuite/winsup.api/ltp/mmap02.c +++ b/winsup/testsuite/winsup.api/ltp/mmap02.c @@ -225,7 +225,7 @@ setup() } /* Write test buffer contents into temporary file */ - if (write(fildes, tst_buff, sizeof(tst_buff)) < (int)sizeof(tst_buff)) { + if (write(fildes, tst_buff, page_sz) < page_sz) { tst_brkm(TFAIL, NULL, "write() on %s Failed, errno=%d : %s", TEMPFILE, errno, strerror(errno)); free(tst_buff); diff --git a/winsup/testsuite/winsup.api/ltp/mmap03.c b/winsup/testsuite/winsup.api/ltp/mmap03.c index 9302d33..fba512c 100644 --- a/winsup/testsuite/winsup.api/ltp/mmap03.c +++ b/winsup/testsuite/winsup.api/ltp/mmap03.c @@ -225,7 +225,7 @@ setup() } /* Write test buffer contents into temporary file */ - if (write(fildes, tst_buff, strlen(tst_buff)) < (int)strlen(tst_buff)) { + if (write(fildes, tst_buff, page_sz) < page_sz) { tst_brkm(TFAIL, NULL, "write() on %s Failed, errno=%d : %s", TEMPFILE, errno, strerror(errno)); free(tst_buff); diff --git a/winsup/testsuite/winsup.api/ltp/mmap04.c b/winsup/testsuite/winsup.api/ltp/mmap04.c index 64d3a8e..dbe25ae 100644 --- a/winsup/testsuite/winsup.api/ltp/mmap04.c +++ b/winsup/testsuite/winsup.api/ltp/mmap04.c @@ -225,7 +225,7 @@ setup() } /* Write test buffer contents into temporary file */ - if (write(fildes, tst_buff, strlen(tst_buff)) < (int)strlen(tst_buff)) { + if (write(fildes, tst_buff, page_sz) < page_sz) { tst_brkm(TFAIL, NULL, "write() on %s Failed, errno=%d : %s", TEMPFILE, errno, strerror(errno)); free(tst_buff); diff --git a/winsup/testsuite/winsup.api/ltp/mmap05.c b/winsup/testsuite/winsup.api/ltp/mmap05.c index bcdfd0c..6e75ee2 100644 --- a/winsup/testsuite/winsup.api/ltp/mmap05.c +++ b/winsup/testsuite/winsup.api/ltp/mmap05.c @@ -228,8 +228,7 @@ setup() } /* Write test buffer contents into temporary file */ - if (write(fildes, tst_buff, strlen(tst_buff)) - != (int)strlen(tst_buff)) { + if (write(fildes, tst_buff, page_sz) != page_sz) { tst_brkm(TFAIL, NULL, "write() on %s Failed, errno=%d : %s", TEMPFILE, errno, strerror(errno)); free(tst_buff); diff --git a/winsup/testsuite/winsup.api/ltp/mmap06.c b/winsup/testsuite/winsup.api/ltp/mmap06.c index ec113c0..c099f8c 100644 --- a/winsup/testsuite/winsup.api/ltp/mmap06.c +++ b/winsup/testsuite/winsup.api/ltp/mmap06.c @@ -197,7 +197,7 @@ setup() } /* Write test buffer contents into temporary file */ - if (write(fildes, tst_buff, strlen(tst_buff)) < (int)strlen(tst_buff)) { + if (write(fildes, tst_buff, page_sz) < page_sz) { tst_brkm(TFAIL, NULL, "write() on %s Failed, errno=%d : %s", TEMPFILE, errno, strerror(errno)); diff --git a/winsup/testsuite/winsup.api/ltp/mmap07.c b/winsup/testsuite/winsup.api/ltp/mmap07.c index ab989f4..6e3bb51 100644 --- a/winsup/testsuite/winsup.api/ltp/mmap07.c +++ b/winsup/testsuite/winsup.api/ltp/mmap07.c @@ -198,7 +198,7 @@ setup() } /* Write test buffer contents into temporary file */ - if (write(fildes, tst_buff, strlen(tst_buff)) < (int)strlen(tst_buff)) { + if (write(fildes, tst_buff, page_sz) < page_sz) { tst_brkm(TFAIL, NULL, "write() on %s Failed, errno=%d : %s", TEMPFILE, errno, strerror(errno)); free(tst_buff); |