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>
* '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]
# 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>
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/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>
* '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
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>
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>
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>
This reverts commit 6126f7a53c
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>
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>
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>
* '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
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>
* 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
...