patches/strace/4.5.17/190-dirent-include.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 15:48:27 2011 +0200 (2011-07-17)
changeset 2886 f1ad0445325c
permissions -rw-r--r--
cc/gcc: simplify calls to core backend

The core backend is going to have more parameters in the upcoming
patches, so it will be a bit complex to handle.

Introduce an array-variable that is filled by the different code-paths
with the required values.

This makes the code easier to read and maintain.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@1182
     1
--- strace-orig/file.c	2008/05/20 04:56:18	1.92
yann@1182
     2
+++ strace/file.c	2008/08/01 01:13:10	1.93
yann@1182
     3
@@ -28,21 +28,22 @@
yann@1182
     4
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
yann@1182
     5
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
yann@1182
     6
  *
yann@1182
     7
- *	$Id: file.c,v 1.92 2008/05/20 04:56:18 roland Exp $
yann@1182
     8
+ *	$Id: file.c,v 1.93 2008/08/01 01:13:10 roland Exp $
yann@1182
     9
  */
yann@1182
    10
 
yann@1182
    11
 #include "defs.h"
yann@1182
    12
 
yann@1182
    13
 #include <dirent.h>
yann@1182
    14
+
yann@1182
    15
 #ifdef LINUX
yann@1182
    16
-#define dirent kernel_dirent
yann@1182
    17
-#define dirent64 kernel_dirent64
yann@1182
    18
-#include <linux/types.h>
yann@1182
    19
-#include <linux/dirent.h>
yann@1182
    20
-#undef dirent
yann@1182
    21
-#undef dirent64
yann@1182
    22
+struct kernel_dirent {
yann@1182
    23
+	unsigned long   d_ino;
yann@1182
    24
+	unsigned long   d_off;
yann@1182
    25
+	unsigned short  d_reclen;
yann@1182
    26
+	char            d_name[1];
yann@1182
    27
+};
yann@1182
    28
 #else
yann@1182
    29
-#define kernel_dirent dirent
yann@1182
    30
+# define kernel_dirent dirent
yann@1182
    31
 #endif
yann@1182
    32
 
yann@1182
    33
 #ifdef LINUX