Skip to content

Commit 463499e

Browse files
committed
Unconditionally include limits.h
According to the Autoconf manual, hosted environments that are still of interest for portable code provide all of the headers specified in C89, which includes limits.h. There's no need in checking for it.
1 parent a719bbb commit 463499e

File tree

10 files changed

+37
-42
lines changed

10 files changed

+37
-42
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ dnl Special checks for header files.
592592
AC_HEADER_STDBOOL
593593

594594
dnl Generic checks for header files.
595-
AC_CHECK_HEADERS([crypt.h inttypes.h limits.h \
595+
AC_CHECK_HEADERS([crypt.h inttypes.h \
596596
stdint.h strings.h sys/bitypes.h sys/filio.h sys/loadavg.h \
597597
sys/select.h sys/time.h sys/uio.h syslog.h unistd.h])
598598

innfeed/article.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
#include <assert.h>
2222
#include <errno.h>
2323
#include <fcntl.h>
24-
#if HAVE_LIMITS_H
25-
# include <limits.h>
26-
#endif
24+
#include <limits.h>
2725
#include <sys/stat.h>
2826
#include <syslog.h>
2927

innfeed/endpoint.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,12 @@
1919
#include <assert.h>
2020
#include <errno.h>
2121
#include <fcntl.h>
22+
#include <limits.h>
2223
#include <signal.h>
2324
#include <sys/stat.h>
2425
#include <sys/uio.h>
2526
#include <syslog.h>
2627

27-
#ifdef HAVE_LIMITS_H
28-
# include <limits.h>
29-
#endif
30-
3128
#ifdef HAVE_SYS_SELECT_H
3229
# include <sys/select.h>
3330
#endif

innfeed/host.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@
1313
#include <ctype.h>
1414
#include <errno.h>
1515
#include <float.h>
16+
#include <limits.h>
1617
#include <math.h>
1718
#include <netdb.h>
1819
#include <sys/param.h>
1920
#include <syslog.h>
2021

21-
#ifdef HAVE_LIMITS_H
22-
# include <limits.h>
23-
#endif
24-
2522
#include "inn/innconf.h"
2623
#include "inn/libinn.h"
2724
#include "inn/messages.h"

lib/fdlimit.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
** Note that on some versions of Linux (2.2.x reported), sysconf may return
1616
** the wrong value for the maximum file descriptors. getrlimit is correct,
1717
** so always prefer it.
18+
**
19+
** Written by Russ Allbery in 2000.
20+
** Various bug fixes, code and documentation improvements since then
21+
** in 2000, 2001, 2006, 2011, 2014, 2021, 2023, 2025.
1822
*/
1923

2024
#include "portable/system.h"
@@ -118,9 +122,7 @@ getfdlimit(void)
118122
}
119123

120124
#else /* no function mechanism available */
121-
# if HAVE_LIMITS_H
122-
# include <limits.h>
123-
# endif
125+
# include <limits.h>
124126
# include <sys/param.h>
125127

126128
int

m4/iov-max.m4

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
dnl Probe for the maximum number of iovecs accepted by writev.
22
dnl
3+
dnl Written by Russ Allbery in 2003.
4+
dnl Various bug fixes, code and documentation improvements since then
5+
dnl in 2009, 2019, 2021, 2022, 2025.
6+
dnl
37
dnl Check for the maximum number of elements in an iovec (IOV_MAX). SVr4
48
dnl systems appear to use that name for this limit (checked Solaris 2.6, IRIX
59
dnl 6.5, and HP-UX 11.00). Linux doesn't have it, but instead has UIO_MAXIOV
@@ -16,15 +20,13 @@ dnl Source used by INN_MACRO_IOV_MAX.
1620
AC_DEFUN([_INN_MACRO_IOV_MAX_SOURCE], [[
1721
#include <errno.h>
1822
#include <fcntl.h>
23+
#include <limits.h>
1924
#include <stdio.h>
2025
#include <sys/types.h>
2126
#include <sys/uio.h>
2227
#ifdef HAVE_UNISTD_H
2328
# include <unistd.h>
2429
#endif
25-
#ifdef HAVE_LIMITS_H
26-
# include <limits.h>
27-
#endif
2830
2931
int
3032
main()
@@ -60,9 +62,7 @@ main()
6062

6163
dnl Headers to use for checking for an IOV_MAX definition.
6264
AC_DEFUN([_INN_MACRO_IOV_MAX_HEADERS], [AC_INCLUDES_DEFAULT] [[
63-
#ifdef HAVE_LIMITS_H
64-
# include <limits.h>
65-
#endif
65+
#include <limits.h>
6666
]])
6767

6868
dnl Do the actual check.

nnrpd/article.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
#include "portable/system.h"
66

77
#include <assert.h>
8-
#if HAVE_LIMITS_H
9-
# include <limits.h>
10-
#endif
118
#include <ctype.h>
9+
#include <limits.h>
1210
#include <sys/uio.h>
1311

1412
#include "cache.h"

storage/buffindexed/buffindexed.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
/*
22
** Overview buffer and index method.
3+
**
4+
** Originally written in 1999.
5+
** Various bug fixes, code and documentation improvements since then
6+
** in 1999-2010, 2013-2017, 2019-2025.
37
*/
48

59
/*
6-
** Buffindexed using shared memory on ovbuff by Sang-yong Suh
10+
** Buffindexed using shared memory on ovbuff by Sang-yong Suh.
711
**
8-
** During the recent discussions in inn-workers, Alex Kiernan found
9-
** that inn_lock_range() is not working for MMAPed file. This explains
10-
** why buffindexed has long outstanding bugs such as "could not MMAP...".
12+
** During the discussions in inn-workers in 2003, Alex Kiernan found
13+
** that inn_lock_range() is not working for MMAPed file. This explains
14+
** why buffindexed has long outstanding bugs such as "could not MMAP...".
1115
**
12-
** This version corrects the file locking error by using shared memory.
13-
** The bitfield of each buffer file is loaded into memory, and is shared
14-
** by all programs such as innd, expireover, makehistory, and overchan.
15-
** The locking problem is handled by semaphore.
16+
** This version corrects the file locking error by using shared memory.
17+
** The bitfield of each buffer file is loaded into memory, and is shared
18+
** by all programs such as innd, expireover, makehistory, and overchan.
19+
** The locking problem is handled by semaphore.
1620
*/
1721

1822
#include "portable/system.h"
@@ -22,9 +26,7 @@
2226
#include <ctype.h>
2327
#include <errno.h>
2428
#include <fcntl.h>
25-
#if HAVE_LIMITS_H
26-
# include <limits.h>
27-
#endif
29+
#include <limits.h>
2830
#include <sys/stat.h>
2931
#include <time.h>
3032

storage/cnfs/cnfs.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
/*
22
** Storage manager module for Cyclic News File System method.
3+
**
4+
** Rewritten and cleaned by Scott Fritchie from its INN 1.5.1 incarnation
5+
** in 1998.
6+
** Various bug fixes, code and documentation improvements since then
7+
** in 1998-2011, 2014, 2015, 2017-2025.
38
*/
49

510
#include "portable/system.h"
@@ -8,9 +13,7 @@
813
#include <ctype.h>
914
#include <errno.h>
1015
#include <fcntl.h>
11-
#if HAVE_LIMITS_H
12-
# include <limits.h>
13-
#endif
16+
#include <limits.h>
1417
#include <netinet/in.h>
1518
#include <sys/stat.h>
1619
#include <sys/uio.h>

storage/ovdb/ovdb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Created in 1999.
77
* Various bug fixes, code and documentation improvements since then
8-
* in 2000-2006, 2008, 2010, 2011, 2013-2015, 2017, 2018, 2021-2024.
8+
* in 2000-2006, 2008, 2010, 2011, 2013-2015, 2017, 2018, 2021-2025.
99
*
1010
* See the full commit history for more details.
1111
* Below follows a list of the major initial changes:
@@ -82,9 +82,7 @@
8282
#include "portable/socket.h"
8383
#include <errno.h>
8484
#include <fcntl.h>
85-
#ifdef HAVE_LIMITS_H
86-
# include <limits.h>
87-
#endif
85+
#include <limits.h>
8886
#include <signal.h>
8987
#ifdef HAVE_SYS_SELECT_H
9088
# include <sys/select.h>

0 commit comments

Comments
 (0)