blob: 517886c7277c84a6102737bf476fa47c4c714072 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001From 19cc68d4a89b59889be442d2997ff030cdc3de73 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 20 Dec 2022 20:11:17 -0800
4Subject: [PATCH] dirent-util: Remove asserts on dirent64 == dirent
5
6We already have assert_cc(_FILE_OFFSET_BITS == 64) which ensures that 64bit LFS functions are same as their original counterparts
7
8Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/25809]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 src/basic/dirent-util.h | 11 -----------
12 1 file changed, 11 deletions(-)
13
14diff --git a/src/basic/dirent-util.h b/src/basic/dirent-util.h
15index 04bc53003f..4cb317184d 100644
16--- a/src/basic/dirent-util.h
17+++ b/src/basic/dirent-util.h
18@@ -35,17 +35,6 @@ struct dirent *readdir_no_dot(DIR *dirp);
19 /* Only if 64bit off_t is enabled struct dirent + struct dirent64 are actually the same. We require this, and
20 * we want them to be interchangeable to make getdents64() work, hence verify that. */
21 assert_cc(_FILE_OFFSET_BITS == 64);
22-assert_cc(sizeof(struct dirent) == sizeof(struct dirent64));
23-assert_cc(offsetof(struct dirent, d_ino) == offsetof(struct dirent64, d_ino));
24-assert_cc(sizeof_field(struct dirent, d_ino) == sizeof_field(struct dirent64, d_ino));
25-assert_cc(offsetof(struct dirent, d_off) == offsetof(struct dirent64, d_off));
26-assert_cc(sizeof_field(struct dirent, d_off) == sizeof_field(struct dirent64, d_off));
27-assert_cc(offsetof(struct dirent, d_reclen) == offsetof(struct dirent64, d_reclen));
28-assert_cc(sizeof_field(struct dirent, d_reclen) == sizeof_field(struct dirent64, d_reclen));
29-assert_cc(offsetof(struct dirent, d_type) == offsetof(struct dirent64, d_type));
30-assert_cc(sizeof_field(struct dirent, d_type) == sizeof_field(struct dirent64, d_type));
31-assert_cc(offsetof(struct dirent, d_name) == offsetof(struct dirent64, d_name));
32-assert_cc(sizeof_field(struct dirent, d_name) == sizeof_field(struct dirent64, d_name));
33
34 #define FOREACH_DIRENT_IN_BUFFER(de, buf, sz) \
35 for (void *_end = (uint8_t*) ({ (de) = (buf); }) + (sz); \
36--
372.39.0
38