The current code returns -errno when not found "mount /foo" in fstab
and mtab does not exist (or /etc/mtab points to non-mounted /proc).
This is problem because the return value is too low-level and maybe
misinterpreted by top level code. It's better to always return
MNT_ERR_NOFSTAB when not found in fstab/mtab.
Reported-by: Dylan Cali <calid1984@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
CppCheck founds a few wrong arguments in format strings and a NULL
pointer dereference.
Amended version with fixed strcmp() usage.
Signed-off-by: Boris Egorov <egorov@linux.com>
When building outside the source tree there is nothing to guarantee the
target directory exists before writing to it. Most of the time this just
happens to work because something else creates the directory but not
always. For example:
$ mkdir build
$ cd build
$ ../configure --disable-dependency-tracking
$ make libuuid/uuid.pc
GEN libuuid/uuid.pc
/bin/sh: line 2: libuuid/uuid.pc.tmp: No such file or directory
make: *** [libuuid/uuid.pc] Error 1
If you delete logical partition and then create a new one than fdisk
(and cfdisk) might write EBR to the first sector on the device. That's
wrong of course; because you will lost MBR (primary partitions).
(Probably introduced by commit bcddbe9688
where code completely clears EBR stuff.)
Reported-by: Michał Górny <mgorny@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
The fdisk_dump_* prefix will be used for sfdisk-like functionality.
The patch also add FDISK_ prefix to fdisk_get_unit() options.
Signed-off-by: Karel Zak <kzak@redhat.com>
fef4dfa174 removed the restriction that the argument must explicitly be
a directory, so let's fix up the documentation to reflect that.
Signed-off-by: Karel Zak <kzak@redhat.com>
BSD disklabels depend on the endianess, but also on the architecture as
one can see in include/pt-bsd.h with the BSD_LABELSECTOR and
BSD_LABELOFFSET #define. This cause the testsuite to fail on the
affected architectures as the disk image is not the same as the expected
result.
Commit 180b3a7e tried to fix the endianess, but the special PowerPC case
has been chosen as a reference, so it still fails for example on MIPS BE
or S/390.
This patch fixes the testsuite by converting the md5sums to the expected
values, still depending on the endianess, but also for the two possible
sectors/offsets. This has been tested on Alpha, MIPS, PowerPC and x86-64,
so this should cover all 4 cases.
Cc: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This makes it match the license of the man pages.
While there, also tweak some other comment lines.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
The fact that 'syslog tcp/514' does not exist in RFS's, which has lead
to 'syslog-conn 601/tcp' be used in place could be a suprice and should
be told in manual.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Setting whole array to be completely full of nulls cannot be as quick as
making the only significant member of the array when needed.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>