summaryrefslogtreecommitdiff
path: root/mail/thunderbird-esr/files/patch-mozilla-ipc-chromium-src-base-dir_reader_linux.h
blob: 5c4e5b79f3d1ed853dc3f2debe70dc76c1b27d73 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- mozilla/ipc/chromium/src/base/dir_reader_linux.h.orig	2011-12-16 21:29:22.000000000 +0100
+++ mozilla/ipc/chromium/src/base/dir_reader_linux.h	2011-12-19 21:00:27.000000000 +0100
@@ -9,6 +9,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <stdint.h>
+#include <sys/dirent.h>
 #include <sys/syscall.h>
 #include <unistd.h>
 
@@ -19,6 +20,8 @@
 
 namespace base {
 
+#define linux_dirent struct dirent
+#if 0
 struct linux_dirent {
   uint64_t        d_ino;
   int64_t         d_off;
@@ -26,11 +29,16 @@
   unsigned char   d_type;
   char            d_name[0];
 };
+#endif
 
 class DirReaderLinux {
  public:
   explicit DirReaderLinux(const char* directory_path)
+#ifdef O_DIRECTORY
       : fd_(open(directory_path, O_RDONLY | O_DIRECTORY)),
+#else
+      : fd_(open(directory_path, O_RDONLY)),
+#endif
         offset_(0),
         size_(0) {
     memset(buf_, 0, sizeof(buf_));
@@ -57,7 +65,7 @@
     if (offset_ != size_)
       return true;
 
-    const int r = syscall(__NR_getdents64, fd_, buf_, sizeof(buf_));
+    const int r = syscall(SYS_getdents, fd_, buf_, sizeof(buf_));
     if (r == 0)
       return false;
     if (r == -1) {