]> git.ipfire.org Git - thirdparty/coreutils.git/commit
stdbuf: port better to Mac OS X 10.4.11
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 24 May 2025 19:47:06 +0000 (12:47 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 24 May 2025 20:02:31 +0000 (13:02 -0700)
commit69b189358551f37f643d8c0d6d52dd504d222048
treebbfb95a566b61fd215d9397588ac709478d6ed14
parentdc4e6b6703513a5b1185af0f8beaaa203c04e028
stdbuf: port better to Mac OS X 10.4.11

Do not link to fchownat, fchmodat, xreallocarray.
While we’re at it, depend as little as possible on problematic
functions like fileno, strtoumax.  Use only functions that
were around in C89.
Problem reported by Peter Dyballa <https://bugs.gnu.org/78509#59>.
* src/libstdbuf.c: Include stddef.h, stdlib.h, gettext.h.
Do not include stdint.h or system.h.
(_): New macro, since we no longer include system.h.
Undef strtoul, not strtoumax.
(fileno_to_name): Remove.  All uses removed.
(apply_mode): New arg STREAM_NAME, so that we no longer need
to depend on fileno which might run into a Gnulib workaround.
Don’t allocate more than ULONG_MAX - 1 bytes, as that’s
not helpful in the real world and this lessens dependency
on newer features like strtoumax.
src/libstdbuf.c