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>
Fedora 17 (/bin is symlink to /usr/bin):
[root@intel ~]# /bin/namei /bin/namei
f: /bin/namei
d /
l bin -> usr/bin
usr - No such file or directory
Reported-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
* multipurpose binaries (symlinks) suck when used with autotools
* swapoff shares small subset of the code with swapon
* usage() and 'struct option' is unnecessary complex when shared
* shorter and simple code is easer to maintain...
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount provides very simple API for paths and tags canonicalizations,
let's use it, rather directly link to libblkid and lib/canonicalize.c.
Signed-off-by: Karel Zak <kzak@redhat.com>
For: util-linux
This patch adds a tiny tool "wdctl" which may be used to query the
status of Linux watchdog devices (/dev/watchdog).
This will simply query all fields that may be queried from the
device and print them nicely formatted.
Signed-off-by: Lennart Poettering <lennart@poettering.net>
Commit fbc333fec0 broke building under uClibc because HAVE_DECL macros are set to 0, not undefined.
Signed-off-by: James Le Cuirot <chewi@aura-online.co.uk>
* '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>
../lib/blkdev.c: In function ‘blkdev_get_geometry’:
../lib/blkdev.c:287:1: warning: control reaches end of non-void function [-Wreturn-type]
Signed-off-by: Karel Zak <kzak@redhat.com>
Instructing sfdisk to create one partition spanning
across entire disk (",,") on 32bit system, if the disk
is sufficiently large (~2TB) leads to wrong calculation
in compute_start_sect() due to type mismatch.
Can be reproduced as:
--------------------------
linux-3ln5:~ # modprobe scsi_debug virtual_gb=2000
linux-3ln5:~ # sfdisk /dev/sda <<< ',,'
Checking that no-one is using this disk right now ...
OK
Disk /dev/sda: 261083 cylinders, 255 heads, 63 sectors/track
sfdisk: ERROR: sector 0 does not have an msdos signature
sfdisk: /dev/sda: unrecognized partition table type
Old situation:
sfdisk: No partitions found
no room for partition descriptor
sfdisk: bad input
--------------------------
Addresses: https://bugzilla.novell.com/show_bug.cgi?id=754789
Reported-by: Dan Mares <dan.mares@norcrossgroup.com>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* Add spaces after dots (English spacing).
* Add line break macros.
* Use URL and email macros where appropriate.
* Fix typo at the end of the manual (s/lsblk/eject/).
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
One some platforms, the -T option can be unreliable (see reference bug
report for some examples). Instead, if the kernel supports the cdrom
status ioctl, use that to ask explicitly for the current tray status
and then open/close accordingly.
The eject_cdrom() func was reworked slightly, but none of the existing
callers care about the explicit normalization to [0,1] values, so have
it return the raw value so we can convert toggle_tray() over to using
that.
Finally, now that toggle_tray() uses a lot of helper functions, drop
the check on CDROMCLOSETRAY. The sub-functions take care of that.
Reference: https://bugs.gentoo.org/261880
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Even if we fail parsing, fstab gets referenced later in the code (and
will subsequently crash via heap corruption). Take the easy way out and
simply avoid deallocating this table, as it will be freed for us on
program exit regardless.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* 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
...