Просмотр исходного кода

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
Родитель
Сommit
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.