This splits check_dos_label() and dos_init() off from get_boot() and gets
rid of the invalid flag 0x00000 warning message due to a check for MBR
signs in zeroized buffer:
memset(MBRbuffer, 0, 512);
if (what == create_empty_dos)
goto got_dos_table;
[...]
got_dos_table:
if (!valid_part_table_flag(MBRbuffer)) {
[...]
if (!valid_part_table_flag(pe->sectorbuffer))
fprintf(stderr, _("Warning: invalid flag 0x%04x of partition "
[...]
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
create_sunlabel() should create a new empty SUN disklabel without checking data
itself writes to memory and initialize internal related fdisk variables.
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
This moves the code for renaming SGI bootfile from command_prompt() to
sgi_set_bootfilename() function.
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
We need a list sorting function, just to mention one example user that could
benefit is the lib/tt code to sort columns.
This patch adds list_sort() which uses the Merge Sort algorithm, behaving
nicely in O(nlog(n)), heavily based on the kernel's implementation[1]. The
private data (void *priv) passed to the comparison function as been removed to
adopt a qsort(3)-like syntax, and IMHO we don't really need it anyways.
[1]: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=lib/list_sort.c;h=d7325c6b103f0be078ff3672c35c468ed35738f1;hb=HEAD
[kzak@redhat.com: - use size_t in list_sort()]
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
Phillip wrote:
If a partition table was detected, but it had no partitions
in it, a poorly worded error message was printed and further
action halted. For partx -a, this gave an unnecessary error.
Reported-by: Phillip Susi <psusi@cfl.rr.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
If you run partx -d to delete partitions, and there are gaps
in the sequence ( partition 2 exists, but 1 doesn't ), then it
would complain that it had errors trying to remove the partitions
that already don't exist. Changed to ignore the error when
errno == ENXIO.
Signed-off-by: Phillip Susi <psusi@cfl.rr.com>
The TIOCSCTTY ioctl requires that caller is session leader -- so it
depends on initd (or we have to add setsid() to aggety). It seems that the
traditional way is to setup tty in agetty and session in login(1).
It means that all session related things (TIOCSCTTY, vhangup, ...) in the
command agetty should be optional. (Note that vhangup() is called when
--hangup is explicitly specified on command line, so log_err() makes
sense there.)
Reported-by: Andrew Walrond <andrew@walrond.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
Examples:
* findmnt --fstab -O noauto
Returns all entries where is not "auto" option (including entries
with "noauto" option.
* findmnt --fstab -O +noauto
Returns all entries where is literally "noauto" option.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=758457
Signed-off-by: Karel Zak <kzak@redhat.com>
Calling abort() as default seems appropriate as the default should be
impossible to reach.
last.c:355:3: warning: switch missing default case [-Wswitch-default]
And simple line removals.
last.c:110:13: warning: redundant redeclaration of 'optind' [-Wredundant-decls]
last.c:111:15: warning: redundant redeclaration of 'optarg' [-Wredundant-decls]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>