Based on libmnt, this patch adds basic debugging support for fdisk. Currently
only CONTEXT is debugged, yet keeps exact functionality as libmnt/libblkid.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
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>
fixes lots of warning noise:
../../../include/c.h:112:0: warning: "container_of" redefined [enabled
by default]
/usr/lib/klibc/include/stddef.h:52:0: note: this is the location of the
previous definition
Signed-off-by: maximilian attems <max@stro.at>
display.c: In function ‘get’:
display.c:262:117: warning: comparison of distinct pointer types lacks
a cast [enabled by default]
Signed-off-by: Karel Zak <kzak@redhat.com>
It's the responsibility of anyone adding to this list in the future to
ensure that the list remains sorted.
While we're at it, expand this list of known pseudofs types.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
If no tabfiles are specified, default to watching /proc/self/mountinfo
rather than exiting silently with EXIT_FAILURE.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
blkid -p dev1 dev2 [...] now stops upon first error detected and
returns correct value. Previously, if error was detected with dev1,
it continued with dev2 anyways and so the return value corresponded
to the last device only.
Reported-by: Bernhard Voelker <bernhard.voelker@siemens-enterprise.com>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* remove --pairs, it was usable for flags table only
* one line for each watchdog device
For example:
# wdctl --noident --noflags --oneline
/dev/watchdog: TIMEOUT="30" TIMELEFT="2"
Signed-off-by: Karel Zak <kzak@redhat.com>
Note that mountpoint (target_ paths in /proc/mounts and /proc/self/mountinfo
are always canonicalized by kernel.
* for umount we don't have to canonicalize target
by default if the mountpoint is found in /proc/self/mountinfo
* in mnt_table_find_target() is unnecessary to canonicalize target paths
if the table of the filesystems is read from /proc/self/mountinfo
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=820707
Signed-off-by: Karel Zak <kzak@redhat.com>