File: ENODATA-BSD.patch

package info (click to toggle)
android-platform-system-core 1%3A8.1.0%2Br23-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 19,480 kB
  • sloc: cpp: 137,841; ansic: 30,813; asm: 3,504; python: 1,754; makefile: 235; sh: 225; xml: 73
file content (28 lines) | stat: -rw-r--r-- 781 bytes parent folder | download
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
Description: `ENODATA` is absent in BSD
 Evidence exists in various places that BSD systems treat `ENODATA` and
 `ENOATTR` as alternatives to each other. See:
 * https://mail-index.netbsd.org/tech-kern/2012/04/30/msg013090.html
 * https://bugzilla.samba.org/show_bug.cgi?id=5714
 * https://lists.freebsd.org/pipermail/freebsd-hackers/2016-May/049494.html
--- a/libutils/include/utils/Errors.h
+++ b/libutils/include/utils/Errors.h
@@ -18,7 +18,7 @@
 #define ANDROID_ERRORS_H
 
 #include <sys/types.h>
-#include <errno.h>
+#include <cerrno>
 
 namespace android {
 
@@ -42,6 +42,10 @@
 # undef NO_ERROR
 #endif
 
+#ifdef __FreeBSD_kernel__
+#define ENODATA ENOATTR
+#endif
+
 enum {
     OK                = 0,    // Everything's swell.
     NO_ERROR          = 0,    // No errors.