Protect us from #defining linux specific ioctls in ext2_fs.h which

may be picked up by autoconfigure scripts and even used at runtime.
Found by brynet@ when building archivers/libarchive.  People agree
(at least brynet@, zhuk@, nadd6@ iirc), the only bikeshed was wether
to remote the #defines completely, used #ifdef __linux__ or #ifndef
__OpenBSD__. I choose the latter for now, because I think i've seen
some consumers of this port where some non-linux systems apparently
*do* support the same ioctls.
This commit is contained in:
kili 2016-03-28 20:08:56 +00:00
parent eb1c1ad46d
commit 4bcf8ed74c
2 changed files with 21 additions and 2 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.36 2015/12/15 10:52:02 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.37 2016/03/28 20:08:56 kili Exp $
COMMENT= utilities to manipulate ext2 filesystems
DISTNAME= e2fsprogs-1.42.12
REVISION= 1
REVISION= 2
CATEGORIES= sysutils devel
SHARED_LIBS= blkid 0.0 \
com_err 21.0 \

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-lib_ext2fs_ext2_fs_h,v 1.1 2016/03/28 20:08:56 kili Exp $
--- lib/ext2fs/ext2_fs.h.orig Sat Aug 2 22:26:22 2014
+++ lib/ext2fs/ext2_fs.h Tue Mar 22 22:26:56 2016
@@ -344,6 +344,7 @@ struct ext4_new_group_input {
#define _IOT_ext2_new_group_input _IOT (_IOTS(__u32), 5, _IOTS(__u16), 2, 0, 0)
#endif
+#ifndef __OpenBSD__
#define EXT2_IOC_GETFLAGS _IOR('f', 1, long)
#define EXT2_IOC_SETFLAGS _IOW('f', 2, long)
#define EXT2_IOC_GETVERSION _IOR('v', 1, long)
@@ -354,6 +355,7 @@ struct ext4_new_group_input {
#define EXT2_IOC_GROUP_ADD _IOW('f', 8,struct ext2_new_group_input)
#define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input)
#define EXT4_IOC_RESIZE_FS _IOW('f', 16, __u64)
+#endif
/*
* Structure of an inode on the disk