Преглед изворни кода

libcompat: Add compat symbol for O_NOFOLLOW

This symbol was only standardized in POSIX.1-2008, which is too recent.
Although it has been available on at least FreeBSD and Linux systems
before that, but dpkg supports other systems which might not have it.
Guillem Jover пре 14 година
родитељ
комит
52a1b3fd94
2 измењених фајлова са 5 додато и 0 уклоњено
  1. 1 0
      configure.ac
  2. 4 0
      lib/compat/compat.h

+ 1 - 0
configure.ac

@@ -85,6 +85,7 @@ DPKG_FUNC_C99_SNPRINTF
 DPKG_CHECK_DECL([offsetof], [stddef.h])
 DPKG_CHECK_DECL([WCOREDUMP], [sys/wait.h])
 DPKG_CHECK_DECL([TIOCNOTTY], [sys/ioctl.h])
+DPKG_CHECK_DECL([O_NOFOLLOW], [fcntl.h])
 DPKG_CHECK_PROGNAME
 DPKG_CHECK_COMPAT_FUNCS([getopt getopt_long obstack_free \
                          strnlen strndup strerror strsignal asprintf \

+ 4 - 0
lib/compat/compat.h

@@ -30,6 +30,10 @@ extern "C" {
 #define offsetof(st, m) ((size_t)&((st *)NULL)->m)
 #endif
 
+#ifndef HAVE_O_NOFOLLOW
+#define O_NOFOLLOW 0
+#endif
+
 /*
  * Define WCOREDUMP if we don't have it already, coredumps won't be
  * detected, though.