bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/7] careadlinkat: use limits-h SSIZE_MAX


From: Paul Eggert
Subject: [PATCH 4/7] careadlinkat: use limits-h SSIZE_MAX
Date: Sat, 20 May 2023 20:33:42 -0700

This also adds a dependency of relocatable-prog-wrapper on
limits-h, since relocatable-prog-wrapper also contains
lib/careadlinkat.c.
---
 ChangeLog                        | 2 ++
 lib/careadlinkat.c               | 4 ----
 modules/careadlinkat             | 1 +
 modules/relocatable-prog-wrapper | 1 +
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c3a0b34130..b9c3e49552 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,8 +2,10 @@
 
        limits-h: other modules can rely on SSIZE_MAX
        * lib/areadlink-with-size.c, lib/areadlinkat-with-size.c:
+       * lib/careadlinkat.c:
        (SSIZE_MAX): Do not define.
        * modules/areadlink-with-size, modules/areadlinkat-with-size:
+       * modules/careadlinkat:
        (Depends-on) Add limits-h.
 
        limits-h: define SSIZE_MAX
diff --git a/lib/careadlinkat.c b/lib/careadlinkat.c
index 72c38e353e..49c92dcc19 100644
--- a/lib/careadlinkat.c
+++ b/lib/careadlinkat.c
@@ -35,10 +35,6 @@
 # define SIZE_MAX ((size_t) -1)
 #endif
 
-#ifndef SSIZE_MAX
-# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
-#endif
-
 #include "allocator.h"
 
 enum { STACK_BUF_SIZE = 1024 };
diff --git a/modules/careadlinkat b/modules/careadlinkat
index 700a89bdb5..05e54e8829 100644
--- a/modules/careadlinkat
+++ b/modules/careadlinkat
@@ -8,6 +8,7 @@ lib/careadlinkat.h
 Depends-on:
 allocator
 idx
+limits-h
 minmax
 ssize_t
 unistd
diff --git a/modules/relocatable-prog-wrapper b/modules/relocatable-prog-wrapper
index e1a14d0448..b2143809ca 100644
--- a/modules/relocatable-prog-wrapper
+++ b/modules/relocatable-prog-wrapper
@@ -64,6 +64,7 @@ idx
 intprops
 largefile
 libc-config
+limits-h
 pathmax
 ssize_t
 stdbool
-- 
2.39.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]