Patch by Mike Frysinger (vapier AT gentoo.org).

* linux/ioctlent.sh: Update sed machinery to parse _IOC() macros
with two constants.
This commit is contained in:
Denys Vlasenko 2009-02-20 17:32:34 +00:00
parent 53560265c6
commit 3566e3d5f2
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2009-02-20 Denys Vlasenko <dvlasenk@redhat.com>
Patch by Mike Frysinger (vapier AT gentoo.org).
* linux/ioctlent.sh: Update sed machinery to parse _IOC() macros
with two constants.
2009-02-20 Denys Vlasenko <dvlasenk@redhat.com>
Patch by Mike Frysinger (vapier AT gentoo.org).

View File

@ -78,9 +78,13 @@ s/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*_
>> ioctls.h
# Some use a special base to offset their ioctls on. Extract that as well.
# Some use 2 defines: _IOC(_IOC_NONE,DM_IOCTL,DM_LIST_DEVICES_CMD,....)
: > ioctldefs.h
bases=$(sed -ne 's/.*_IOC_NONE.*,[[:space:]]*\([A-Z][A-Z0-9_]\+\)[[:space:]+,].*/\1/p' ioctls.h | uniq | sort)
bases=$(sed -n \
-e 's/.*_IOC_NONE.*,[[:space:]]*\([A-Z][A-Z0-9_]\+\)[[:space:]]*,[[:space:]]*\([A-Z][A-Z0-9_]\+\)[[:space:]+,].*/\1\n\2/p' \
-e 's/.*_IOC_NONE.*,[[:space:]]*\([A-Z][A-Z0-9_]\+\)[[:space:]+,].*/\1/p' \
ioctls.h | sort | uniq)
for base in $bases ; do
echo "Looking for $base"
regexp="^[[:space:]]*#[[:space:]]*define[[:space:]]\+$base"