summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge branch 'master' of https://github.com/nazarov-yuriy/util-linuxKarel Zak2014-06-191-0/+1
|\
| * lib/loopdev.c: reset errno before strtol() callYuriy Nazarov2014-06-191-0/+1
| | | | | | | | Fixed unsuccessful attempt to find unused loop devices if 0-7 devices already used and /dev/loop directory exists.
* | build-sys: fixes for non-Linux systemsSamuel Thibault2014-06-191-0/+6
|/ | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/fileutils: xalloc stuff in library-like codeKarel Zak2014-06-181-4/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: fix compiler warning [-Wunused-variable]Karel Zak2014-06-181-1/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: remove test_wholediskKarel Zak2014-06-171-5/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: remove obsolete wholedisk.cKarel Zak2014-06-172-63/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: add sysfs_devno_is_wholedisk()Karel Zak2014-06-171-0/+18
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: add sysfs_devno_is_lvm_private() from libblkidKarel Zak2014-06-171-0/+28
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/fileutils: add stripoff_last_component() from libmountKarel Zak2014-06-092-11/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/fileutils: add mkdir_p() from libmountKarel Zak2014-06-091-0/+36
|
* docs: fix "behaviour" vs. "behavior"Karel Zak2014-06-061-1/+1
| | | | | | | | Sometimes we use "behaviour" and "behavior" in the same text, let's use "behavior" only everywhere. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1011068 Signed-off-by: Karel Zak <kzak@redhat.com>
* build: fix some compiler warningsRuediger Meier2014-05-301-1/+4
| | | | | | | | | | | | Most of them catched on 32bit gcc and icc. disk-utils/fsck.cramfs.c: printf format type lib/boottime.c: unused variables misc-utils/cal.c: set but never used sys-utils/losetup.c: set but never used sys-utils/lscpu-dmi.c: defined but not used sys-utils/switch_root.c: comparison between signed and unsigned tests/helpers/test_sysinfo.c: printf format type
* losetup: don't clear FD at EBUSY error in loopcxt_setup_device()Stanislav Brabec2014-05-281-1/+1
| | | | | | | | | loopback lib clears the existing FD unconditionally at error in loopcxt_setup_device(). This is done even after EBUSY, thus the second call actually clears the previous setup wrongly. Author: Takashi Iwai <tiwai@suse.de> Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* lib/canonicalize: make DM canonicalization more robustKarel Zak2014-05-201-15/+30
| | | | | | | | The current code cares about filenames, but it's too fragile, we have to check the path is really path to the block device. Addresses: https://github.com/karelzak/util-linux/issues/83 Signed-off-by: Karel Zak <kzak@redhat.com>
* lslogins: also add readutmp.cOndrej Oprala2014-05-151-0/+76
|
* lslogins: add functionalityOndrej Oprala2014-05-151-1/+2
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* losetup: fix -f on systems without /dev/loop-controlKarel Zak2014-05-141-14/+35
| | | | | Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/colors: add to the man page hint about $HOME stuffKarel Zak2014-05-131-1/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/colors: update man pageKarel Zak2014-05-131-11/+140
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/colors: support schemes customizationKarel Zak2014-05-131-83/+419
| | | | | | | | | | | | | | | | * parse terminal-colors.d/*.scheme files, expected format is <name> <color-sequence> * supported color sequences: - color name (e.g. "red") - dir_colors compatible xx;yy (e.g. 01;31) where the sequence may contains control chars like \e \a ..etc. * scheme is parsed on demand Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/colors: allow to temporary disable colorsKarel Zak2014-05-131-30/+75
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/colors: add support for @term and /home/kzakKarel Zak2014-05-131-31/+268
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/boottime: add a new fileKarel Zak2014-05-061-0/+34
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/timeutils: remove get_boot_time from libcommonKarel Zak2014-05-061-26/+0Star
| | | | | | | | clock_gettime() needs -lrt, so let's keep this stuff outside libcommon.la Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/terminal-colors.d.5: Improve the typesetting of the manualBjarni Ingi Gislason2014-05-061-9/+9
| | | | | | | | | | Remove '\&' in front of a full stop (.), when it does not start or end a string Adjust space between sentences to two space characters (or begin each sentence on a new line). Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
* lib/colors: change an include to a local oneBenno Schulenberg2014-05-061-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* lib/pager: use names when referring to standard file descriptorsSami Kerola2014-05-061-9/+9
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib/timeutils: fix memory leakSami Kerola2014-05-061-0/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* dmesg: move get_boot_time() to lib/timeutilsSami Kerola2014-05-041-0/+29
| | | | | | In future the last(1) will use get_boot_time() as well. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib/procutils: notice setuid() process ownership changesSami Kerola2014-04-261-4/+5
| | | | | | | | | Earlier the owner of a process was determined by owner of the /proc/<pid>/stat file. When changes user ID privileges with setuid() the stat file ownership is not updated, that resulted kill(1) to consider such processes where running using same uid as the present process. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib/procutils: reset errno before strtol() callSami Kerola2014-04-261-1/+2
| | | | | | | | When going through /proc the last entry made readdir() to alter errno, which made the strtol() to think something went wrong, resulting kill(1) tests to fail when running in --parallel mode. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib/mbalign: report also size in bytesKarel Zak2014-04-151-10/+30
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/mbsalign: split mbs_safe_encode()Karel Zak2014-04-151-12/+33
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: rewrite test code to tree(1)-like utilKarel Zak2014-04-081-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tt.c: Goodbye!Ondrej Oprala2014-04-032-998/+0Star
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* mcookie: use lib/randutilsSami Kerola2014-03-261-0/+22
| | | | | | | | | The mcookie should reuse existing code, and there is definitely no need to prefer /dev/random for this utility. See reference for explanation about later statement. References: http://www.2uo.de/myths-about-urandom/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib/colors: care about colors only on tty()Karel Zak2014-03-121-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/strutils: fix parse_size() return codeKarel Zak2014-03-111-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/colors: fix colors testKarel Zak2014-03-111-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tt: keep track about output orderKarel Zak2014-03-111-1/+20
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tt: add tt_line_get_userdata()Karel Zak2014-03-111-0/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/strutils: support dec.points in parse_size()Karel Zak2014-03-111-2/+43
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/strutils: use proper return codes in parse_size()Karel Zak2014-03-111-9/+14
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/mbalign: add mbs_safe_width() from tt.cKarel Zak2014-03-112-136/+136
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/tt: add function to convert table to stringKarel Zak2014-03-111-0/+26
| | | | | | | Note that open_memstream() is POSIX-1.2008, so it's possible than not all libc have already implemented this function. Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tt: add reduce term width functionalityKarel Zak2014-03-111-0/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tt: add TT_FL_MAX to fill screenKarel Zak2014-03-111-2/+32
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tt: add tb_get_nlines()Karel Zak2014-03-111-0/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tt: don't hardcode stdout as outputKarel Zak2014-03-111-13/+21
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>