summaryrefslogtreecommitdiff
path: root/misc-utils
AgeCommit message (Collapse)AuthorFilesLines
2013-04-09various: fix shadow declarations [smatch scan]Sami Kerola1-1/+0
libmount/src/tab.c:990:34: warning: symbol 'fs' shadows an earlier one libmount/src/tab.c:970:26: originally declared here misc-utils/findmnt.c:492:30: warning: symbol 'tmp' shadows an earlier one misc-utils/findmnt.c:473:14: originally declared here fdisks/fdiskdoslabel.c:211:36: warning: symbol 'pe' shadows an earlier one fdisks/fdiskdoslabel.c:180:20: originally declared here fdisks/fdiskdoslabel.c:639:34: warning: symbol 'i' shadows an earlier one fdisks/fdiskdoslabel.c:578:16: originally declared here fdisks/fdiskdoslabel.c:947:21: warning: symbol 'i' shadows an earlier one fdisks/fdiskdoslabel.c:924:16: originally declared here fdisks/fdiskdoslabel.c:976:29: warning: symbol 'i' shadows an earlier one fdisks/fdiskdoslabel.c:924:16: originally declared here fdisks/fdiskdoslabel.c:984:29: warning: symbol 'i' shadows an earlier one fdisks/fdiskdoslabel.c:924:16: originally declared here [kzak@redhat.com: - don't use local 'tmp' in findmnt.c] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-08uuidd.8: Document --debug and --quiet long options.Ville Skyttä1-2/+2
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2013-04-08logger: make socket initialization in main() more readableKarel Zak1-4/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-08logger: allow to log using tcp transport protocolSami Kerola2-62/+113
This commit fixes error in usage() text, which claimed TCP is default transport protocol. That was not true, and neither it should be. The syslog messages has traditionally sent using UDP. For the logger remains using UDP as first transport, but if it fails a TCP connection is attempted. If an user wishes remote logging can be forced to use either UDP or TCP. The service port for UDP is familiar 'syslog', for TCP the port 'syslog-conn' seems like reasonable default. [kzak@redhat.com: - rename myopenlog to unix_socket(), - always reset st to -1] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-05logger: make local sockets to try both stream and datagramSami Kerola1-17/+25
When journald, from systemd, is in use logger gave following error. $ logger --socket /dev/log test logger: connect /dev/log: Protocol wrong type for socket The journald supports only AF_DGRAM, and nothing else. Support for AF_STREAM sockets was dropped because it messed up message ordering. From an users point of view necessity to add --udp (UNIX(TM) Datagram Protocol?) option when talking to syslog via unix socket felt confusing and wrong. The command should know what is the socket type, and silently use the correct one, unless the type is explicitely defined. CC: Karel Zak <kzak@redhat.com> Adviced-by: Lennart Poettering <lennart@poettering.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-05getopt: fix usage() typo unquote -> unquotedKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-05findmnt: fix typo fsroot -> nofsrootKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-03blkid: use O_CLOEXECKarel Zak1-1/+1
... to make "strace -e open blkid" for libblkid stuff without exceptions. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-29lsblk: add --pathsKarel Zak2-19/+45
Now it's not so simple to generate full paths to devices if you want to use user friendly names like /dev/mapper/foo. Let's make it easy.
2013-03-27wipefs: make do_wipe() more readable [coverity scan]Karel Zak1-1/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-27rename: fix memory leak [coverity scan]Karel Zak1-1/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-27wipefs: fix memory leak [coverity scan]Karel Zak1-2/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-27getopt: fix normalize() usage [coverity scan]Karel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-27lsblk: check returns [coverity scan]Karel Zak1-1/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-26blkid: use xalloc.h when possibleSami Kerola1-4/+5
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-03-20docs: make the section AVAILABILITY always come last in man pagesBenno Schulenberg4-12/+12
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-03-20docs: normalize formatting of lslocks man pageBenno Schulenberg1-24/+31
Also alphabetize the options and improve some wording. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-03-20docs: normalize formatting of wipefs man pageBenno Schulenberg1-30/+38
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-03-20docs: normalize formatting of findmnt man pageBenno Schulenberg1-28/+56
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-03-20docs: sort the options in findmnt man page alphabeticallyBenno Schulenberg1-63/+65
Also improve wording and formatting a bit. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-03-20blkid: also accept -V for displaying version informationBenno Schulenberg2-3/+4
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-03-20docs: improve wording and formatting of blkid man pageBenno Schulenberg1-70/+67
Furthermore, explain the device argument right at the beginning, since it is not an option, and alphabetize -k. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-03-20whereis: canonicalize directories pathsKarel Zak2-5/+7
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-19wipefs: add -f to getopt_long()Karel Zak1-1/+1
Reported-by: Dan Horák <dhorak@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-19docs: generic whereis.1 clean upSami Kerola1-36/+25
Align with howto-man-page.txt, and more importantly remove out dated 'SEE ALSO' and 'BUGS' sections. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-03-19whereis: support MANPATH environment variableSami Kerola2-14/+19
The MANPATH has been around long enough that it can be added to whereis default search path. Reference: manpath(1) Addresses: http://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-19whereis: align with howto-usage-function.txtSami Kerola1-18/+15
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-03-19whereis: add search scope listing optionSami Kerola2-1/+39
Mostly useful when debugging why the command does, or does not, work. Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-19whereis: rewrite most of the commandSami Kerola1-263/+310
The earlier code gave little or no change to fix bugs and improve the command. This rewrite attempts to make further patching easier. Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com> Co-Author: Karel Zak <kzak@redhat.com>
2013-03-18docs: add TB to list of supported suffixesKarel Zak2-2/+2
Reported-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-14chkdupexe: remove, deprecated for yearsKarel Zak4-166/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-14findmnt: add FREQ and PASSNO columnsKarel Zak1-1/+17
... to provide all information from fstab. Reported-by: Roger Leigh <rleigh@codelibre.net> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-13kill: support --list=<signal>Karel Zak2-10/+18
The '=' is expected for optional arguments and required in procps version. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-13kill: add pretty printed list output (for compatibility with procps)Sami Kerola2-48/+89
* add -L, --table References: http://www.freelists.org/post/procps/kill1-consolidation Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-12kill: use new API from lib/procutils.cKarel Zak4-145/+24
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-12docs: add long options and tidy up kill.1Sami Kerola1-41/+45
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-03-12kill, procs: use pid_t for pidsSami Kerola3-13/+13
Reference: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/linux/threads.h#n30 Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-12kill: use libc error printing facilities and exit valuesSami Kerola2-33/+25
Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-12kill: align with howto-usage-function.txtSami Kerola1-7/+21
[kzak@redhad.com: - s/commandname/name/ - improve --all description - add -h/--help] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-12kill: add long optionsSami Kerola1-5/+5
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-03-04docs: improve wording, grammar and formatting of lsblk man pageBenno Schulenberg1-58/+78
Also sort the options alphabetically. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-03-04docs: improve grammar and formatting of explanation of "-o +list"Benno Schulenberg3-6/+6
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-02-18findmnt: allow to read (PART)UUID/LABEL from udev DBKarel Zak2-14/+78
Currently findmnt uses libmount to get filesystem properties (and libmount uses libblkid). This works as expected, but root permissions are required to read the tags from the devices. It seems better to read the information from udev db and use libblkid as fallback solution only. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-18lsblk: resuse udev handlerKarel Zak1-4/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-18docs: add missing information about -o +<list>Karel Zak2-0/+6
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-18lslocks: support -o +<list> conventionKarel Zak2-5/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-18lslocks: add BLOCKER columnKarel Zak2-21/+44
BLOCKER - PID of the process blocking the lock Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-14lslocks: detect blocked locks, fix /proc/locks parserKarel Zak2-7/+12
$ flock foo -c "sleep 100" & flock foo -c "sleep 100" old version: $ lslocks lslocks: failed to parse pid: 'WRITE' new version: COMMAND PID TYPE SIZE MODE M START END PATH [...] flock 1318 FLOCK 0B WRITE* 0 0 0 /home/projects/ flock 1319 FLOCK 0B WRITE 0 0 0 /home/projects/ The asterisk (e.g. WRITE*) is used for blocked processes. Reported-by: Mantas Mikulenas <grawity@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-14lslocks: use libmount to parse mountinfoKarel Zak2-18/+17
old version: $ strace -e open lslocks 2>&1 | grep mountinfo | wc -l 118 new version: strace -e open ./lslocks 2>&1 | grep mountinfo | wc -l 1 Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-06a pointer should not be compared to zero [coccinelle]Sami Kerola1-3/+3
Signed-off-by: Sami Kerola <kerolasa@iki.fi>