This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix build error introduced by scandir64 change yesterday.


Hi all,

The change in the scandir64 interface yesterday broke the build on
PowerPC.  I suspect it broke elsewhere too.  Basically the internal
interface for the scandir64 didn't match the new interface.  This patch
fixes that.  I suspect you may have other thoughts on how to fix this
(there are many ways).

Regards,
Ryan


2009-03-16  Ryan S. Arnold  <rsa@us.ibm.com>

	* dirent/scandir.c (SCANDIR): Conditionally define the parameters to
	support the old interface.
	* include/dirent.h (__scandir64): Conditionally define the old
	internal interface.
	* sysdeps/unix/sysv/linux/i386/olddirent.h (__OLD_SCANDIR64): Request
	the old inteface before including scandir.c.

--- glibc/dirent/scandir.c	2009-03-16 16:17:21.000000000 -0500
+++ glibc.new/dirent/scandir.c	2009-03-16 15:54:18.000000000 -0500
@@ -57,7 +57,11 @@
      const char *dir;
      DIRENT_TYPE ***namelist;
      int (*select) (const DIRENT_TYPE *);
+#ifndef __OLD_SCANDIR64
      int (*cmp) (const DIRENT_TYPE **, const DIRENT_TYPE **);
+#else
+     int (*cmp) (const void *, const void *);
+#endif
 {
   DIR *dp = __opendir (dir);
   DIRENT_TYPE **v = NULL;
--- glibc/include/dirent.h	2009-03-16 16:17:22.000000000 -0500
+++ glibc.new/include/dirent.h	2009-03-16 15:51:10.000000000 -0500
@@ -14,10 +14,18 @@
 			struct dirent **__result);
 extern int __readdir64_r (DIR *__dirp, struct dirent64 *__entry,
 			  struct dirent64 **__result);
+#ifndef __OLD_SCANDIR64
+extern int __scandir64 (__const char * __dir,
+			struct dirent64 *** __namelist,
+			int (*__selector) (__const struct dirent64 *),
+			int (*__cmp) (__const struct dirent64 **, __const struct dirent64 **));
+#else
 extern int __scandir64 (__const char * __dir,
 			struct dirent64 *** __namelist,
 			int (*__selector) (__const struct dirent64 *),
 			int (*__cmp) (__const void *, __const void *));
+#endif
+
 extern __ssize_t __getdents (int __fd, char *__buf, size_t __nbytes)
      internal_function;
 extern __ssize_t __getdents64 (int __fd, char *__buf, size_t __nbytes)
--- glibc/sysdeps/unix/sysv/linux/i386/olddirent.h	2009-03-16 16:17:23.000000000 -0500
+++ glibc.new/sysdeps/unix/sysv/linux/i386/olddirent.h	2009-03-16 15:50:37.000000000 -0500
@@ -19,6 +19,7 @@
 #ifndef __OLD_DIRENT_H
 #define __OLD_DIRENT_H 1
 
+#define __OLD_SCANDIR64 1
 #include <dirent.h>
 
 struct __old_dirent64



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]