]> git.ipfire.org Git - thirdparty/util-linux.git/commit
fdisk: introduce fdisk context
authorDavidlohr Bueso <dave@gnu.org>
Mon, 21 May 2012 20:28:03 +0000 (22:28 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 23 May 2012 08:53:05 +0000 (10:53 +0200)
commit823f0fd107415ced8edde12306b9134058aafdc0
treee5f7edcc875cd7013e23c2320232d1943990e5be
parent6da365de2db02344f8d2633dfdab256d86e4be4c
fdisk: introduce fdisk context

This is the first patch that adds the initial parts of the new fdisk internal
API. Two functions are created to both init and deinit the fdisk context. Only
the device's descriptor and path are added as a start and these are replaced
throughout fdisk.c and label specific code.

All logic that opens the file does it with fdisk_new_context_from_filename(),
and this enforces always opening the device with rw, then, if unsuccesfull,
with read-only. This changes the current logic that opens the device with
certain permissions depending on the user given options.  For example, -l opens
the device read-only.

This patch passed regression tests and local modifications for sgi/dos/sun disk
labels.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
fdisk/Makefile.am
fdisk/fdisk.c
fdisk/fdisk.h
fdisk/fdiskbsdlabel.c
fdisk/fdiskdoslabel.c
fdisk/fdisksgilabel.c
fdisk/fdisksunlabel.c
fdisk/utils.c [new file with mode: 0644]