summaryrefslogtreecommitdiff
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
parent25c99d499407dff25f2528de2cb8652afa26288c (diff)
force definition of _POSIX2_LINE_MAX
-rw-r--r--src/grp/getgrent.c10
-rw-r--r--src/pwd/getpwent.c10
2 files changed, 12 insertions, 8 deletions
diff --git a/src/grp/getgrent.c b/src/grp/getgrent.c
index 3046d040..417e1ba2 100644
--- a/src/grp/getgrent.c
+++ b/src/grp/getgrent.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 <grp.h>
#include "stdlib.h"
@@ -9,14 +14,11 @@
#include "_grp.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 group * getgrent(void)
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)