maint: fts.c: move __opendir2 #define "up" out of function body
[gnulib.git] / lib / glob.c
index f46159b..85419cc 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991-2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-   Free Software Foundation, Inc.
+/* Copyright (C) 1991-2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
 # include <config.h>
 #endif
 
+/* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
+   optimizes away the pattern == NULL || pglob == NULL tests below.  */
+#define _GL_ARG_NONNULL(params)
+
 #include <glob.h>
 
 #include <errno.h>
@@ -1279,6 +1282,8 @@ link_exists_p (int dfd, const char *dir, size_t dirlen, const char *fname,
     return link_exists2_p (dir, dirlen, fname, pglob);
   else
     {
+      /* dfd cannot be -1 here, because dirfd never returns -1 on
+         glibc, or on hosts that have fstatat.  */
       struct_stat64 st64;
       return __fxstatat64 (_STAT_VER, dfd, fname, &st64, 0) == 0;
     }