Skip to content

Commit bee8782

Browse files
committed
os.h.in: correct fix for PATH_MAX is 0 definition
A previous commit was hard-coding PATH_MAX to a non-zero value. This is not correct, as 0 would be expected on systems without a file system. The correct solution is to include the <limits.h> header file that defines this value. Signed-off-by: Keith Holman <keith.holman@windriver.com>
1 parent fccd918 commit bee8782

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/os.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ typedef struct os_system_info
270270
* @brief Maximum path length
271271
*/
272272
#ifndef PATH_MAX
273-
# define PATH_MAX 4096
273+
# define PATH_MAX 0
274274
#endif
275275

276276

src/os_posix.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#endif
1414

1515
#include <stdarg.h> /* for: va_list */
16+
#include <limits.h> /* for: PATH_MAX definition */
1617
#include <stdio.h> /* for: FILE *, feof, fgets, fread, fputs, fwrite, fprintf, printf, snprintf, vfprintf */
1718
#include <signal.h> /* for SIGINT, ... */
1819

0 commit comments

Comments
 (0)