summaryrefslogtreecommitdiffstats
path: root/lib/ismounted.c
Commit message (Collapse)AuthorAgeFilesLines
* lib/ismounted: use xstrncpy()Karel Zak2019-05-201-4/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: use unique ifdefs for testsKarel Zak2017-01-041-1/+1
| | | | | | | Let's use unique TEST_PROGRAM_<NAME> ifdefs to make build system more robust. Signed-off-by: Karel Zak <kzak@redhat.com>
* Add sizelimit to internal APIStanislav Brabec2016-08-031-1/+1
| | | | | | | | | | | | | | Fully safe checks of loop device need to check sizelimit. To prevent need of two nearly equal functions, introduce sizelimit parameter to several internal functions: loopdev_is_used() loopdev_find_by_backing_file() loopcxt_is_used() loopcxt_find_by_backing_file() If sizelimit is zero, fall back to the old behavior (ignoring of sizelimit). Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* Revert "include sysmacros.h where used"Karel Zak2016-03-081-1/+0Star
| | | | This reverts commit 46a40c018438b7b2b25083a5e5a4a21055a0c1e9.
* include sysmacros.h where usedMike Frysinger2016-03-081-0/+1
| | | | | | | | BSD/Linux systems stick major/minor/makedev in sysmacros.h. Newer Linux libraries have been moving away from including sysmacros.h implicitly via sys/types.h, so include it directly. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* lib: fix ismounted includes for FreeBSDRuediger Meier2016-02-181-3/+8
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* lib: fix unused parameters and variablesRuediger Meier2016-02-111-11/+13
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* lib/ismounted: make it more compatible with lsblk outputKarel Zak2014-08-011-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/ismounted: more robust buffer usage [clang-analyze]Karel Zak2014-07-011-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: use O_CLOEXEC in libcommonKarel Zak2013-04-031-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* a pointer should not be compared to zero [coccinelle]Sami Kerola2013-02-061-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib/ismounted: improve loopdev supportKarel Zak2012-12-191-18/+9Star
| | | | | | | ... to make it usable for situations when the same backing file is mapped to more loop devices. Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/ismounted: basic support for loop devicesKarel Zak2012-12-191-10/+34
| | | | | | | | | | | | | | | | | | | | | | # losetup -a /dev/loop0 /dev/loop0: [2053]:1048578 (/home/fs-images/filesystems/ext2.img) # findmnt /dev/loop0 TARGET SOURCE FSTYPE OPTIONS /mnt/test /dev/loop0 ext3 rw,relatime,data=ordered old version: ./test_ismounted /home/fs-images/filesystems/ext2.img not mounted new version: ./test_ismounted /home/fs-images/filesystems/ext2.img mounted on /mnt/test Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: check HAVE_ definitions with #ifdef [smatch scan]Sami Kerola2011-12-021-1/+1
| | | | | | Fix to `warning: undefined preprocessor identifier' messages. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib: [ismounted] don't wast time with mtab is /proc/mounts usedKarel Zak2010-11-241-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* portability: fix mntent.h and pty.h usageFrançois Revol2010-07-261-0/+6
| | | | | Signed-off-by: François Revol <revol@free.fr> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: minor changes for GNU/HurdSamuel Thibault2010-06-141-0/+1
| | | | | | Here is a patch to fix the build on GNU/Hurd. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* lib: import whole ismounted.c code from e2fsprogsKarel Zak2009-10-141-70/+232
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: fix file descriptor leak in is_mounted()Theodore Ts'o2009-10-031-3/+0Star
| | | | | | Remove an extraneous fopen() that leaks memory and a file descriptor. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* lib: do not include <linux/fd.h> in ismounted.cAurelien Jarno2009-04-201-1/+0Star
| | | | | | | <linux/fd.h> is included for no reason in lib/ismounted.c. This obviously breaks on non-Linux systems. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tests: add fsck:ismounted reg.testKarel Zak2009-02-181-4/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: add test_ismounted for regression testKarel Zak2009-02-181-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck: cosmetic changes (NLS, paths, ...)Karel Zak2009-02-181-3/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck: move fsck from e2fsprogs to util-linux-ngKarel Zak2009-02-181-0/+199
Signed-off-by: Karel Zak <kzak@redhat.com>