libmount uses libblkid to detect filesystem type. Unfortunately, the
blkid probe struct is not freed before mount(2), it means that the
device is still open and mount(2) may return EBUSY.
We don't need persistent blkid stuff in libmount, so let's close
all immediately after device probing.
Reported-by: David Zeuthen <zeuthen@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Use the newly exported mnt_get_mountpoint to determine the device that a
given file resides on, in case the supplied source or target is not
explicitly a mount point.
http://www.spinics.net/lists/util-linux-ng/msg06081.html
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* all tt based utils will properly encode blank chars for raw output
format and quotes for export output format
Signed-off-by: Karel Zak <kzak@redhat.com>
mount /foo /bar
without entry in /etc/fstab the mount command tries all filesystems
from /{etc,proc}/filesystems. We should NOT call mount(2) more then
once if the syscall returns for example ENOENT, acceptable is only
EINVAL.
Signed-off-by: Karel Zak <kzak@redhat.com>
With -Wall -Werror, compilation of lscpu.c fails with:
Making all in sys-utils
make[2]: Entering directory `/home/petr/upstream/util-linux/sys-utils'
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -include ../config.h -I../include -DLOCALEDIR=\"/usr/share/locale\" -fsigned-char -Wall -Werror -MT lscpu.o -MD -MP -MF .deps/lscpu.Tpo -c -o lscpu.o lscpu.c
lscpu.c: In function ‘print_parsable’:
lscpu.c:971:7: error: operation on ‘p’ may be undefined [-Werror=sequence-point]
cc1: all warnings being treated as errors
Fix by splitting the pointer increment to separate statement.
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Since commit 0b0c231f64
(swapon: move generic code to swapon-common.c), if util-linux is
configured with --enable-static --disable-shared --enable-libmount-mount
options, the build fails with the following error:
...
libtool: link: gcc -std=gnu99 -fsigned-char -ggdb -O1 -Wall -D_FORTIFY_SOURCE=2 -o switch_root switch_root.o
/home/petr/upstream/util-linux/libblkid/src/.libs/libblkid.a(befs.o): In function `get_uuid':
/home/petr/upstream/util-linux/libblkid/src/superblocks/befs.c:333: multiple definition of `get_uuid'
swapon-swapon-common.o:/home/petr/upstream/util-linux/sys-utils/swapon-common.c:99: first defined here
collect2: ld returned 1 exit status
/bin/sh ../libtool --tag=CC --mode=link gcc -std=gnu99 -fsigned-char -ggdb -O1 -Wall -D_FORTIFY_SOURCE=2 -o flock flock.o strutils.o
libtool: link: gcc -std=gnu99 -fsigned-char -ggdb -O1 -Wall -D_FORTIFY_SOURCE=2 -o pivot_root pivot_root.o
make[2]: *** [swapon] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/petr/upstream/util-linux/libblkid/src/.libs/libblkid.a(befs.o): In function `get_uuid':
/home/petr/upstream/util-linux/libblkid/src/superblocks/befs.c:333: multiple definition of `get_uuid'
swapoff-swapon-common.o:/home/petr/upstream/util-linux/sys-utils/swapon-common.c:99: first defined here
Fix by declaring befs funcitons static.
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
This is no longer in sys-utils/ anyways, and its unconditionally
distributed by an earlier dist_man_MANS declare in the Makefile.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
getdtablesize() is the number of descriptors and since decriptors start
at 0, its value isnt the largest descriptors possible. One should use
getdtablesize() - 1 instead.
Signed-off-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
The tool misspellings (https://github.com/lyda/misspell-check)
detected several typos. Command used:
$ git ls-files | grep -v ^po/ | misspellings -f -
* isosize: Fix typo in usage string.
* configure.ac: Fix typo in help string of --enable-most-builds option.
* fdisk: Fix typo in man page.
* libblkid, blkid, mount: Likewise.
* Fix various typos in docs and in source code comments.
Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
This patch makes fdisk open(2) the device in only one place (get_boot), instead
of having to depend on user input (ie: listing -l).
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
When creating a new DOS label, SGI and SUN pt logic have no business being
there. Remove sun/sgi_nolabel(), since the default amount of partitions are
previously set to 4 and the sun/sgi magic nums are not used in this context.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
When some program' output exceeds the terminal's dimensions, it is a nice
feature to call a pager that acts as calling 'less' to allow better user
navigation. This patch adds this functionality, based on what perf and git
have (ie: git log).
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Fedora 17 (/bin is symlink to /usr/bin):
[root@intel ~]# /bin/namei /bin/namei
f: /bin/namei
d /
l bin -> usr/bin
usr - No such file or directory
Reported-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>