summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* lib/mbalign: report also size in bytesKarel Zak2014-04-151-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/mbsalign: split mbs_safe_encode()Karel Zak2014-04-151-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tt.c: Goodbye!Ondrej Oprala2014-04-032-116/+0Star
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* include/carefulputc: cleanup and add fputs_{quoted,nonblank}()Karel Zak2014-04-031-3/+42
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mcookie: use lib/randutilsSami Kerola2014-03-261-0/+1
| | | | | | | | | 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>
* include/debug: add another debug macrosKarel Zak2014-03-211-1/+17
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/debug: fix coding styleKarel Zak2014-03-211-21/+22
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'common_debug' of https://github.com/ooprala/util-linuxKarel Zak2014-03-212-0/+67
|\ | | | | | | | | | | | | | | | | | | | | | | * 'common_debug' of https://github.com/ooprala/util-linux: clean up redundant macros and defines libfdisk: use include/debug.h libblkid: use include/debug.h libmount: further debug.h integration libcommon: don't mention lib versions in debug macros libcommon: define more debugging macros libmount: use macros from include/debug.h libcommon: add common debugging routines
| * clean up redundant macros and definesOndrej Oprala2014-03-131-8/+0Star
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
| * libcommon: don't mention lib versions in debug macrosOndrej Oprala2014-03-131-3/+0Star
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
| * libcommon: define more debugging macrosOndrej Oprala2014-03-121-0/+7
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
| * libcommon: add common debugging routinesOndrej Oprala2014-03-122-0/+71
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | include/closestream: don't wipe errno on EPIPEKarel Zak2014-03-131-1/+2
|/ | | | | | | ... the code in close_stdout() is sensitive to EPIPE, so wipe errno is close_stream() is probably bad idea. Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tt: keep track about output orderKarel Zak2014-03-111-1/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tt: add tt_line_get_userdata()Karel Zak2014-03-111-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/list: add void data to the sort cmp functionKarel Zak2014-03-111-9/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/mbalign: add mbs_safe_width() from tt.cKarel Zak2014-03-111-2/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/xalloc: add xvasprintf()Karel Zak2014-03-111-0/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/tt: add function to convert table to stringKarel Zak2014-03-111-0/+1
| | | | | | | 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/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tt: add TT_FL_MAX to fill screenKarel Zak2014-03-111-6/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tt: add tb_get_nlines()Karel Zak2014-03-111-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tt: don't hardcode stdout as outputKarel Zak2014-03-111-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/tt: add tt_is_empty()Karel Zak2014-03-111-0/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/colors: check for /etc/terminal-colors.d/[util].disableOndrej Oprala2014-03-112-2/+6
| | | | | | | | [kzak@redhat.com: - move paths to pathnames.h, - use static path buffer] Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add statfs_magic.hKarel Zak2014-03-062-1/+90
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/color: add colorscheme parserKarel Zak2014-02-101-0/+1
|
* losetup: wait for udevKarel Zak2014-01-241-0/+1
| | | | | | | | | | | | | On system with /dev/lop-control the udevd creates /dev/loopN nodes. It seems better to wait a moment after unsuccessful open(/dev/loopN) and try it to open again. The problem is pretty visible on systems where udevd also modifies permission for loopN devices, then open() fails with EACCES when losetup executed by non-root user (but user who is in "disk" group). Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1045432 Signed-off-by: Karel Zak <kzak@redhat.com>
* include/c.h: prefer nanosleep() over usleep()Karel Zak2014-01-242-8/+17
| | | | | | | | | | | | | | Let's use nanosleep() although if usleep() exists. The nanosleep function does no interact with signals and other timers. The patch introduces xusleep() as replacement to libc (or our fallback) usleep(). Yes, we don't want to use struct timespec + nanosleep() everywhere in code as nano-time resolution is useless for us. The patch also enlarges delays in some busy wait loops. It seems enough to try read/write 4x per second. Signed-off-by: Karel Zak <kzak@redhat.com>
* unshare: Add possibility to add mapping into root user in user namespaceLubomir Rintel2014-01-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it very convenient to use make use of privileged actions on CONFIG_USER_NS enabled kernels, without having to manually tinker with uid_map and gid_map to obtain required credentials (as those given upon unshare() vanish with call to execve() and lot of userspace checks for euid==0 anyway). Usage example: $ unshare --uts unshare: unshare failed: Operation not permitted $ unshare --user --uts [nfsnobody@odvarok ~]$ hostname swag hostname: you must be root to change the host name $ unshare -r --uts [root@odvarok util-linux]# hostname swag [root@odvarok util-linux]# [kzak@redhat.com: - move code to map_id() - use all-io.h - add paths to pathnames.h] Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/path: add path_strdup()Karel Zak2014-01-061-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: update links to http://git.kernel.org/ web repository viewsSami Kerola2013-11-121-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* strutils: add skip_space() functionOndrej Oprala2013-11-081-0/+18
| | | | | | | | [kzak@redhat.com: - add also skip_blank(), - remove duplicate implementation from libmount] Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: Add missing includesMichael Forney2013-10-041-0/+3
| | | | | | | | sys/types.h: For u_char typedef sys/params.h: For MAXNAMLEN sys/ttydefaults.h: For various tty definitions (also add configure check) Signed-off-by: Karel Zak <kzak@redhat.com>
* nologin: add new commandKarel Zak2013-09-301-0/+2
| | | | | | | Currently it's maintained as distro specific (or people use impolite /bin/false way). Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: fix include Makemodule.amKarel Zak2013-09-261-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add -L to colorize outputKarel Zak2013-09-161-2/+17
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: (bsd) write/read PT code cleanupKarel Zak2013-09-161-3/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: move bsd definitions to pt-bsd.hKarel Zak2013-09-162-0/+160
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: move mbr code to the libraryKarel Zak2013-09-162-0/+106
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add mbr_get_partition()Karel Zak2013-09-161-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: use functions from pt-mbr.hKarel Zak2013-09-161-8/+29
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: rename sys_type to sys_indKarel Zak2013-09-161-1/+1
| | | | | | | This makes struct dos_partition more compatible with the current fdisk code. Signed-off-by: Karel Zak <kzak@redhat.com>
* include/pt-mbr: add functio to store leKarel Zak2013-09-161-0/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: move MBR definitions to include/pt-mbr.hKarel Zak2013-09-161-0/+37
|
* fdisk: (sgi) fix checksum calculationKarel Zak2013-09-161-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: move MBR partition types to include/Karel Zak2013-09-162-0/+107
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: (sgi) cleanup devparams flagsKarel Zak2013-09-161-1/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: (sgi) cleanu sgi_info stuffKarel Zak2013-09-161-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: (sgi) remove magic stringsKarel Zak2013-09-161-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>