summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* lib/strutils: add string_add_to_idarray() - parse and add to id listMilan Broz2012-07-261-0/+4
| | | | | Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: define format to be constant in xasprintf()Sami Kerola2012-07-261-1/+2
| | | | | | Add also format function attribute to add robustness. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include/optutils: remove unnecessary exclusive_option()Karel Zak2012-07-261-14/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/optutils: add err_exclusive_options()Karel Zak2012-07-261-0/+75
| | | | | | | | | | | This is improved implementation of exclusive_option(). The new implementation: - uses regular struct option to compose error messages - relationships between options are described in one const static array - the current status is stored in one int array Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: add fileback for SEEK_DATAKarel Zak2012-07-241-0/+11
| | | | | Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: use configured run state directorySami Kerola2012-07-101-0/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: add pager.h to Makemodule.amKarel Zak2012-06-261-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: convert include/ to moduleKarel Zak2012-06-262-45/+44Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/loopdev: use warn_unused_result forimportant functionsKarel Zak2012-06-211-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: use warn_unused_result for sysfs_init()Karel Zak2012-06-211-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include [optutils]: add exclusive_option() inline functionSami Kerola2012-06-171-0/+19
| | | | | | | The exclusive_option() will unify how exclusive options are determined. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib/blkdev: return static strings by blkdev_scsi_type_to_name()Karel Zak2012-06-151-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/blkdev: cleanup upKarel Zak2012-06-151-24/+27
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch '2012wk23' of git://github.com/kerolasa/lelux-utiliteetitKarel Zak2012-06-153-4/+25
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * '2012wk23' of git://github.com/kerolasa/lelux-utiliteetit: lsblk: use blkdev_scsi_type_to_name() blkdev: add blkdev_scsi_type_to_name() wipefs: use symbolic value for markup mode eject: inform if CD-ROM drive is not ready docs: clean up partx.8 manual include: fix void pointer arithmetics warnings sysfs: fix printf format warnings build: fix unused parameter warnings build: fix redundant redeclaration warnings include: fix spurious list.h warnings uuidd: use output redirection which works [checkbashisms] blkid: fix realloc memory leak [cppcheck] setarch: do not use -1 as array index [cppcheck]
| * blkdev: add blkdev_scsi_type_to_name()Sami Kerola2012-06-111-0/+21
| | | | | | | | | | | | | | | | Add a function, and necessary symbols, to convert scsi type id's to name strings. Reference: http://permalink.gmane.org/gmane.linux.utilities.util-linux-ng/5994 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * include: fix void pointer arithmetics warningsSami Kerola2012-06-111-2/+2
| | | | | | | | | | | | | | all-io.h:18:9: warning: pointer of type 'void *' used in arithmetic [-pedantic] all-io.h:38:9: warning: pointer of type 'void *' used in arithmetic [-pedantic] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * include: fix spurious list.h warningsSami Kerola2012-06-111-2/+2
| | | | | | | | | | | | | | | | | | include/list.h:224:17: warning: ISO C forbids omitting the middle term of a ?: expression [-pedantic] include/list.h:255:19: warning: ISO C forbids omitting the middle term of a ?: expression [-pedantic] Compilation warned about that at least 110 times. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | losetup: improve -a to report loopdevs < 512 bytesKarel Zak2012-06-121-0/+1
|/ | | | | | | | | | | | | | | | | | # ll ~/xxx2 -rw-r--r-- 1 root root 500 Jun 12 14:30 /root/xxx2 old version: # losetup -a new version: # losetup -a /dev/loop0: [2052]:535312 (/root/xxx2) The new version scans /sys/block/loopN, kernel >= 2.6.37 is required otherwise fallback to the original not-so-smart /proc/partitions scan. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=730266 Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch '2012wk22' of git://github.com/kerolasa/lelux-utiliteetitKarel Zak2012-06-051-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * '2012wk22' of git://github.com/kerolasa/lelux-utiliteetit: docs: clean up getopt.1 manual docs: clean up dmesg.1 manual docs: clean up chcpu.8 manual fileutils: xmkstemp() interface change docs: fix all man page groff warnings tools: add checkmans.sh docs: clean up wdctl.8 manual docs: clean up login.1 manual login: allow TTYGROUP name begin by number build-sys: add su executable to .gitignore logindefs: change getlogindefs_num() to return unsigned long Conflicts: login-utils/su.c sys-utils/dmesg.1
| * fileutils: xmkstemp() interface changeDave Reisner2012-06-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | We can not let the user control where TMPDIR is for this tempfile. This will be where we write the updated passwd file, and must be capable of being moved atomically with rename(2). Therefore, it cannot be on a different device, or setpwnam() and vipw/vigr programs will invariably fail with EXDEV. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | inclide/env: innclude c.h, remove _() macro from xsetenv()Karel Zak2012-06-051-1/+3
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | su: introduce xsetenv globallyLudwig Nussel2012-06-051-0/+7
| | | | | | | | Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
* | lib/strutils: circumvent missing localeconv()maximilian attems2012-06-051-0/+6
|/ | | | | | | Add stub too nls.h, include it instead of locale.h. Code in strutils handles already returned NULL. Signed-off-by: maximilian attems <max@stro.at>
* include/c: move fallback for MAXHOSTNAMELEN to c.hKarel Zak2012-05-291-0/+11
| | | | | Reported-by: Thomas Schwinge <thomas@codesourcery.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: [c.h] protect container_ofmaximilian attems2012-05-231-0/+2
| | | | | | | | | | fixes lots of warning noise: ../../../include/c.h:112:0: warning: "container_of" redefined [enabled by default] /usr/lib/klibc/include/stddef.h:52:0: note: this is the location of the previous definition Signed-off-by: maximilian attems <max@stro.at>
* lib/tt: export tt_fputs_{quoted,nonblank} functionKarel Zak2012-05-221-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/strutils: create type specific strtoxx_or_err()Karel Zak2012-05-151-2/+12
| | | | | | | We need [un]signed int ([u]int32_t) on many places. It's also more readable and robust to use uintXX_t types than for example "long long". Signed-off-by: Karel Zak <kzak@redhat.com>
* include/ttyutils: more robust get_terminal_width()Karel Zak2012-05-151-2/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: move get_terminal_width() to ttyutils.hPetr Uzel2012-05-151-0/+29
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* libuuid: move read_all to include/all-io.hPetr Uzel2012-05-151-0/+25
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* include: rename writeall.h to all-io.hPetr Uzel2012-05-152-4/+4
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* libuuid: avoid double open and leaking fd (reworked)Petr Uzel2012-05-101-1/+1
| | | | | | | | | | | | | | This reverts commit 6126f7a53c57485a9a29ddd772765695f23c92e6 and fixes the double open and leaking descriptor in a different way, that is by using newly introduced function 'have_random_source()' to check whether good random source is available while deciding which uuid type to generate (random/time). This is better than calling random_get_fd() twice, passing the file descriptor down the stack and reusing it in next call to random_get_fd(). Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* libuuid: avoid double open and leaking descriptorPetr Uzel2012-05-041-1/+1
| | | | | | | | | | | | | We are opening /dev/urandom twice in uuid_generate(): first to check if the file is available and then later __uuid_generate_random() again to actually get the random data. Moreover, descriptor from the first open is leaking. Fix by passign the descriptor down the stack and reusing it there. References: http://marc.info/?l=util-linux-ng&m=133406051131131&w=2 Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* lib/strutils: add string_to_bitmask()Karel Zak2012-05-031-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/tt: remove obsolete stuffKarel Zak2012-05-031-3/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wdctl: align with other util-linux commandsSami Kerola2012-05-031-0/+2
| | | | | | | | | * Add watchdog device path to pathnames.h * Check output stream status at exit. * Adjust usage() notation to follow howto file. * Retire numeric return value. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Merge branch '2012wk17' of https://github.com/kerolasa/lelux-utiliteetitKarel Zak2012-05-021-0/+10
|\ | | | | | | | | * '2012wk17' of https://github.com/kerolasa/lelux-utiliteetit: build-sys: determine availability of __fpending()
| * build-sys: determine availability of __fpending()Sami Kerola2012-04-231-0/+10
| | | | | | | | | | | | | | | | Needed to for making Cygwin more possible. Reference: http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5656 Reported-by: Bernhard Voelker <bernhard.voelker@siemens-enterprise.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | build-sys: add ttyutils.h to distPetr Uzel2012-04-271-0/+1
| | | | | | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* | build-sys: add randutils.h to distPetr Uzel2012-04-271-0/+1
| | | | | | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* | lib/mangle: cleanup, add unhexmangleKarel Zak2012-04-261-0/+7
|/ | | | | | | | * use strchr() rather than for() * small refactoring in mangle code * add un-hex-mangle Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/fileutils: add get_fd_tabsize()Karel Zak2012-04-231-1/+4
| | | | | | as a fallback for the function getdtablesize() Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: add pager functionalityDavidlohr Bueso2012-04-231-0/+6
| | | | | | | | | 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>
* libblkid: add support for PARTUUID= and PARTLABEL=Karel Zak2012-04-191-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'close_stream' of git://github.com/kerolasa/lelux-utiliteetitKarel Zak2012-04-112-0/+42
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'close_stream' of git://github.com/kerolasa/lelux-utiliteetit: disk-utils: verify writing to streams was successful fdisk: verify writing to streams was successful getopt: verify writing to streams was successful hwclock: verify writing to streams was successful login-utils: verify writing to streams was successful misc-utils: verify writing to streams was successful mount: verify writing to streams was successful partx: verify writing to streams was successful schedutils: verify writing to streams was successful sys-utils: verify writing to streams was successful term-utils: verify writing to streams was successful text-utils: verify writing to streams was successful include: add stream error checking facility Conflicts: fdisk/fdisk.c
| * include: add stream error checking facilitySami Kerola2012-04-042-0/+42
| | | | | | | | | | | | | | | | | | The close_stream() is copied from GNU lib. Inspiration to do this is talk by Jim Meyering - Goodbye World! The perils of relying on output streams in C. Reference: http://www.irill.org/events/ghm-gnu-hackers-meeting/videos/jim-meyering-goodbye-world-the-perils-of-relying-on-output-streams-in-c Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | lib: random utilitiesDavidlohr Bueso2012-04-101-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a random number(s) generator specific file. The intial functions are based on what libuuid provide. I did some modifications like avoid WIN32 checks - this is util-LINUX. [kzak@redhat.com: - move jrand_seed to lib/randutils.c - use TLS for jrand_seed (like original code from libuuid) - use size_t for buffer sizes - add close() to random_get_bytes] Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* | fdisk: move kernel geometry into blkdevDavidlohr Bueso2012-04-101-0/+3
| | | | | | | | | | | | This is a more generic place for this ioctl. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* | Merge branch 'eject'Karel Zak2012-04-052-0/+3
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * eject: (47 commits) tests: use eject --force eject: use BUILD_EJECT, move to sys-utils eject: clean up usage() eject: clean up man page eject: add --force option eject: check for hotplug/removable attribute eject: remove obsolete code, use EXIT_* macros tests: add umount-by-eject tests eject: improve work with partitioned devices lib/sysfs: improve sysfs_is_partition_dirent() eject: call umount <mountpoint> rather than <device> eject: use libmount to detect if cdrom is mounted eject: make the code robust eject: use SG_IO ioctl for scsi eject: support CDIOCEJECT ioctl eject: new close_tray code from Fedora eject: new auto_eject code from Fedora eject: add -X from Fedora eject: add --manualeject from fedora eject: clean up devname usage ...
| * eject: add -X from FedoraKarel Zak2012-03-271-0/+1
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>