OSDN Git Service

Don't define our own ioctls unless we have to.
authorPeter Jones <pjones@redhat.com>
Fri, 10 Oct 2014 21:09:51 +0000 (17:09 -0400)
committerPeter Jones <pjones@redhat.com>
Wed, 15 Oct 2014 14:42:34 +0000 (10:42 -0400)
commit2483d2705324270e8ebb43f3ebaba151c46b01cf
treeb9b8b6fd9f9c3ce57159a18842cd7f200be549ba
parent34254ed1aa158f97f9a822d7580c43f46a717649
Don't define our own ioctls unless we have to.

The way it was, BLKGETSIZE64 wound up being 0x80041272 instead of the
0x80081272 it should be on -m32 builds.  4 isn't the size of 64 bits, so
that results in integer overflow into who knows what space on the stack,
and when we compare it to our gpt header, it's also just plain wrong.

This is all madness, of course, the kernel has exported all of this
stuff since the ancient past.  Use that instead.

Signed-off-by: Peter Jones <pjones@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Tested-by: Michael Tokarev <mjt@tls.msk.ru>
src/include/disk.h
src/lib/disk.c
src/lib/gpt.c