]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: date: check that write errors are promptly diagnosed
authorCollin Funk <collin.funk1@gmail.com>
Mon, 3 Nov 2025 06:36:31 +0000 (22:36 -0800)
committerCollin Funk <collin.funk1@gmail.com>
Tue, 4 Nov 2025 01:05:57 +0000 (17:05 -0800)
This improvement is due to changes to Gnulib's fprintftime module.

* NEWS: Mention the improvement.
* src/getlimits.c (OFF64_T_MAX, OFF64_T_MIN): New macros.
(main): Print them.
* tests/misc/write-errors.sh: Call getlimits_. Add a date invocation.

NEWS
src/getlimits.c
tests/misc/write-errors.sh

diff --git a/NEWS b/NEWS
index fa14e7a2cd5ee23040ee1bca78759628dad42442..0a81cf7b50fd2bb251f3630e1cc196f6f54c6d7e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -66,8 +66,8 @@ GNU coreutils NEWS                                    -*- outline -*-
 
 ** Improvements
 
-  'fmt', 'nl', and 'pr' will now exit promptly upon receiving a write error,
-  which is significant when reading large / unbounded inputs.
+  'fmt', 'date', 'nl', and 'pr' will now exit promptly upon receiving a write
+  error, which is significant when reading large / unbounded inputs.
 
   install, sort, and split now use posix_spawn() to invoke child programs more
   efficiently and more independently from their own memory usage.
index 1cd10a6e987a7ee6a72ab3e466d2ec245efa7183..db44967e765e7d8cdff7467be495e6b061792ffd 100644 (file)
 # define PID_T_MIN TYPE_MINIMUM (pid_t)
 #endif
 
+#ifndef OFF64_T_MAX
+# define OFF64_T_MAX TYPE_MAXIMUM (off64_t)
+#endif
+
+#ifndef OFF64_T_MIN
+# define OFF64_T_MIN TYPE_MINIMUM (off64_t)
+#endif
+
 /* These are not interesting to print.
  * Instead of these defines it would be nice to be able to do
  * #ifdef (TYPE##_MIN) in function macro below.  */
@@ -161,6 +169,7 @@ main (int argc, char **argv)
   print_int (GID_T);
   print_int (PID_T);
   print_int (OFF_T);
+  print_int (OFF64_T);
   print_int (INTMAX);
   print_int (UINTMAX);
 
index 612658c6a66f40c8820e880dfa2b98d8f3f022c5..47220584a9362e1c2153c62b7c0eb317821fdd8f 100755 (executable)
@@ -18,6 +18,7 @@
 
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ timeout env
+getlimits_
 
 if ! test -w /dev/full || ! test -c /dev/full; then
   skip_ '/dev/full is required'
@@ -30,6 +31,7 @@ cat /dev/zero
 comm -z /dev/zero /dev/zero
 cut -z -c1- /dev/zero
 cut -z -f1- /dev/zero
+date +%${OFF64_T_MAX}c
 date --version; yes 0 | date -f-
 dd if=/dev/zero
 expand /dev/zero