summaryrefslogtreecommitdiff
path: root/src/pwd/getpwent.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-08-16 18:30:38 -0400
committerJakob Kaivo <jkk@ung.org>2020-08-16 18:30:38 -0400
commit5756352383087295b5bb5aea5c0dbaa7354ef3bd (patch)
tree9f42ae089cbc7472768b5565666f244208b96540 /src/pwd/getpwent.c
parent25c99d499407dff25f2528de2cb8652afa26288c (diff)
force definition of _POSIX2_LINE_MAX
Diffstat (limited to 'src/pwd/getpwent.c')
-rw-r--r--src/pwd/getpwent.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pwd/getpwent.c b/src/pwd/getpwent.c
index 675f8aa3..cdf20e8e 100644
--- a/src/pwd/getpwent.c
+++ b/src/pwd/getpwent.c
@@ -1,3 +1,8 @@
+#if ((!defined _POSIX_C_SOURCE) || (_POSIX_C_SOURCE < 2))
+#undef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 2
+#endif
+
#include <sys/types.h>
#include <pwd.h>
#include <stdlib.h>
@@ -9,14 +14,11 @@
#include "_pwd.h"
#ifndef LINE_MAX
-#ifndef _POSIX2_LINE_MAX
-#include "limits/_POSIX2_LINE_MAX.c"
-#endif
#define LINE_MAX _POSIX2_LINE_MAX
#endif
#ifndef _XOPEN_SOURCE
- static
+static
#endif
struct passwd * getpwent(void)