]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
13 years agoctrlaltdel: minor changes to usage()
Karel Zak [Tue, 27 Sep 2011 11:26:06 +0000 (13:26 +0200)] 
ctrlaltdel: minor changes to usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoarch: minor changes to usage()
Karel Zak [Tue, 27 Sep 2011 11:25:53 +0000 (13:25 +0200)] 
arch: minor changes to usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoMerge branch 'sys-utils' of https://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Tue, 27 Sep 2011 10:56:48 +0000 (12:56 +0200)] 
Merge branch 'sys-utils' of https://github.com/kerolasa/lelux-utiliteetit

* 'sys-utils' of https://github.com/kerolasa/lelux-utiliteetit: (29 commits)
  docs: add non-return function and if shorthand tips
  build-sys: fixes to USAGE_* macros
  ipcrm: check IPC syscalls
  ipcrm: add --verbose option
  ipcmk: allow high speed ipc creation
  ipcrm: add --all option
  docs: add long options to ipcs.1 man page
  docs: add long options to ipcrm.1 man page
  docs: add long options to ipcmk.1 man page
  docs: add --version to setarch.8
  docs: mention long options in ctrlaltdel.8
  ctrlaltdel: add version & help options
  docs: mention long options in pivot_root.8
  pivot_root: add version & help option
  ipcs: comment & white space clean up
  ipcs: include-what-you-use header check
  ipcs: add long options
  ipcrm: include-what-you-use header check
  ipcrm: refactor new and old main to share code
  ipcrm: exit if unknown error occurs
  ...

13 years agomount: use common libs
Davidlohr Bueso [Wed, 14 Sep 2011 18:07:06 +0000 (15:07 -0300)] 
mount: use common libs

Get rid of the local xmalloc.[c/h] files by using the global xalloc and
strutils libraries.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agolscpu: add column names to --help
Karel Zak [Tue, 27 Sep 2011 10:45:42 +0000 (12:45 +0200)] 
lscpu: add column names to --help

 * use uppercase by default (only -p uses lowercase)
 * a little cleanup usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolscpu: gettextize two columns
Karel Zak [Tue, 27 Sep 2011 10:26:02 +0000 (12:26 +0200)] 
lscpu: gettextize two columns

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoagetty: test ECHO on c_lflag
Karel Zak [Mon, 26 Sep 2011 10:34:10 +0000 (12:34 +0200)] 
agetty: test ECHO on c_lflag

Reported-by: xinglp <xinglp@gmail.com>
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=739522
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodocs: add non-return function and if shorthand tips
Sami Kerola [Sat, 17 Sep 2011 12:35:15 +0000 (14:35 +0200)] 
docs: add non-return function and if shorthand tips

Non-return functions should not be combined with `else' clause.

The if shorthands `var = e ? t : f;' need to fit to single line,
and if that does not look good use normal "if else" syntax.

Both tips are mentioned in email bellow.

http://www.spinics.net/lists/util-linux-ng/msg05152.html

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agobuild-sys: fixes to USAGE_* macros
Sami Kerola [Sat, 17 Sep 2011 10:52:32 +0000 (12:52 +0200)] 
build-sys: fixes to USAGE_* macros

The USAGE_BEGIN_TAIL is removed as unnecessary.

In between command specific options and --help & --version
USAGE_SEPARATOR is inserted. For now the separator is empty line.

The USAGE_MAN_TAIL is changed to take an argument.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcrm: check IPC syscalls
Davidlohr Bueso [Wed, 14 Sep 2011 17:02:15 +0000 (14:02 -0300)] 
ipcrm: check IPC syscalls

It's not enough to check errno for errors as the variable is not
reset, we also need to check the last syscall return value to
verify a problem. This addresses bogus msgqueue errors when
deleting keys.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcrm: add --verbose option
Sami Kerola [Tue, 13 Sep 2011 20:00:13 +0000 (22:00 +0200)] 
ipcrm: add --verbose option

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcmk: allow high speed ipc creation
Sami Kerola [Mon, 12 Sep 2011 20:01:03 +0000 (22:01 +0200)] 
ipcmk: allow high speed ipc creation

This commit will allow user to create quickly plenty of ipc
resources. Earlier the line bellow gave no satisfaction.

for i in $(seq 0 42); do ipcmk -Q; done

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcrm: add --all option
Sami Kerola [Mon, 12 Sep 2011 16:56:30 +0000 (18:56 +0200)] 
ipcrm: add --all option

An --all option will remove all ipc entries. The option takes
optional resource argument, which limits the removal to be
applied only the given resource entries.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agodocs: add long options to ipcs.1 man page
Sami Kerola [Mon, 5 Sep 2011 20:05:37 +0000 (22:05 +0200)] 
docs: add long options to ipcs.1 man page

Includes few style fixes from Documentation/howto-man-page.txt
and align information by what is being said by The Open Group.

http://pubs.opengroup.org/onlinepubs/009604599/utilities/ipcs.html

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agodocs: add long options to ipcrm.1 man page
Sami Kerola [Mon, 5 Sep 2011 19:29:54 +0000 (21:29 +0200)] 
docs: add long options to ipcrm.1 man page

Includes few style fixes from Documentation/howto-man-page.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agodocs: add long options to ipcmk.1 man page
Sami Kerola [Mon, 5 Sep 2011 19:16:08 +0000 (21:16 +0200)] 
docs: add long options to ipcmk.1 man page

Includes few style fixes from Documentation/howto-man-page.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agodocs: add --version to setarch.8
Sami Kerola [Mon, 5 Sep 2011 18:56:30 +0000 (20:56 +0200)] 
docs: add --version to setarch.8

Includes few style fixes from Documentation/howto-man-page.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agodocs: mention long options in ctrlaltdel.8
Sami Kerola [Wed, 31 Aug 2011 18:59:48 +0000 (20:59 +0200)] 
docs: mention long options in ctrlaltdel.8

Includes other manual page maintenance fixes.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoctrlaltdel: add version & help options
Sami Kerola [Wed, 31 Aug 2011 18:52:01 +0000 (20:52 +0200)] 
ctrlaltdel: add version & help options

Including other necessary changes to usage().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agodocs: mention long options in pivot_root.8
Sami Kerola [Wed, 31 Aug 2011 18:37:29 +0000 (20:37 +0200)] 
docs: mention long options in pivot_root.8

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agopivot_root: add version & help option
Sami Kerola [Wed, 31 Aug 2011 18:33:27 +0000 (20:33 +0200)] 
pivot_root: add version & help option

Including other necessary changes to usage().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcs: comment & white space clean up
Sami Kerola [Mon, 29 Aug 2011 19:47:36 +0000 (21:47 +0200)] 
ipcs: comment & white space clean up

Add to multiline comments to have left side stars, convert spaces
to tabs and indent preprocessor directives

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcs: include-what-you-use header check
Sami Kerola [Mon, 29 Aug 2011 19:34:48 +0000 (21:34 +0200)] 
ipcs: include-what-you-use header check

Two includes added & a sort to alphabetical order.

ipcs.c should add these lines:
 #include <features.h>                   // for __GLIBC__
 #include <stddef.h>                     // for size_t

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcs: add long options
Sami Kerola [Mon, 29 Aug 2011 19:15:36 +0000 (21:15 +0200)] 
ipcs: add long options

Includes necessary usage() changes.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcrm: include-what-you-use header check
Sami Kerola [Mon, 29 Aug 2011 18:12:41 +0000 (20:12 +0200)] 
ipcrm: include-what-you-use header check

Three removes & a sort to alphabetical order.

ipcrm.c should remove these lines:
- #include <ctype.h>  // lines 29-29
- #include <sys/types.h>  // lines 18-18
- #include <unistd.h>  // lines 27-27

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcrm: refactor new and old main to share code
Sami Kerola [Sun, 28 Aug 2011 18:24:07 +0000 (20:24 +0200)] 
ipcrm: refactor new and old main to share code

The code is now much more tidy, and as a bonus old main has
shares error printing with the `new' code.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcrm: exit if unknown error occurs
Sami Kerola [Sun, 28 Aug 2011 17:01:56 +0000 (19:01 +0200)] 
ipcrm: exit if unknown error occurs

Previously for instance lack of memory space caused unknown
reason to be printed, and ipcrm tried to continue.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agomount: check for target before source on remount
Karel Zak [Tue, 13 Sep 2011 20:59:39 +0000 (22:59 +0200)] 
mount: check for target before source on remount

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=737091
Reported-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolib: do not attempt to close(0) in sysfs_deinit()
Petr Uzel [Tue, 13 Sep 2011 09:08:46 +0000 (11:08 +0200)] 
lib: do not attempt to close(0) in sysfs_deinit()

If the 'open' fails we 'goto err' which runs 'sysfs_deinit()' on a 'cxt'
which hasn't been fully initialised. The 'dir_fd' is still 0, so
sysfs_deinit calls "close(0)".

Addresses: https://bugzilla.novell.com/show_bug.cgi?id=714151
Reported-by: Diego Ercolani <diego.ercolani@gmail.com>
Analysed-by: Neil Brown <nfbrown@suse.com>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
13 years agochfn: remove non-ANSI definitions [smatch scan]
Karel Zak [Tue, 13 Sep 2011 09:21:47 +0000 (11:21 +0200)] 
chfn: remove non-ANSI definitions [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: add err and errx to smatch no_return_funcs
Karel Zak [Tue, 13 Sep 2011 09:15:43 +0000 (11:15 +0200)] 
build-sys: add err and errx to smatch no_return_funcs

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: add smatch data
Karel Zak [Tue, 13 Sep 2011 09:10:18 +0000 (11:10 +0200)] 
build-sys: add smatch data

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoipcrm: add long options
Sami Kerola [Sun, 28 Aug 2011 16:30:23 +0000 (18:30 +0200)] 
ipcrm: add long options

With long options usage function had to be changed. The change
also takes libc error printing facilities to use, primarily to
get rid of execname & progname variables.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcmk: include-what-you-use header check
Sami Kerola [Sun, 28 Aug 2011 11:30:36 +0000 (13:30 +0200)] 
ipcmk: include-what-you-use header check

Three removes & a sort to alphabetical order.

ipcmk.c should remove these lines:
- #include <string.h>  // lines 24-24
- #include <sys/types.h>  // lines 30-30
- #include <unistd.h>  // lines 29-29

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcmk: remove camel casing
Sami Kerola [Sun, 28 Aug 2011 11:24:32 +0000 (13:24 +0200)] 
ipcmk: remove camel casing

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcmk: validate numeric option arguments
Sami Kerola [Sun, 28 Aug 2011 11:16:23 +0000 (13:16 +0200)] 
ipcmk: validate numeric option arguments

Use strtoul_or_err() instead of atoi().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcmk: remove useless code
Sami Kerola [Sun, 28 Aug 2011 11:09:03 +0000 (13:09 +0200)] 
ipcmk: remove useless code

Checking same return value twice does not make command any
better. Secondly the program_invocation_short_name is known to
work, so global progname variable does not add anything extra.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoipcmk: add long options & fix usage()
Sami Kerola [Sun, 28 Aug 2011 10:39:59 +0000 (12:39 +0200)] 
ipcmk: add long options & fix usage()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoscript: non-ANSI definition [smatch scan]
Karel Zak [Mon, 12 Sep 2011 14:18:16 +0000 (16:18 +0200)] 
script: non-ANSI definition [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agowhereis: non-ANSI definition [smatch scan]
Karel Zak [Mon, 12 Sep 2011 14:15:19 +0000 (16:15 +0200)] 
whereis: non-ANSI definition [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agologger: non-ANSI definition [smatch scan]
Karel Zak [Mon, 12 Sep 2011 14:13:58 +0000 (16:13 +0200)] 
logger: non-ANSI definition [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agocal: non-ANSI definition [smatch scan]
Karel Zak [Mon, 12 Sep 2011 14:12:45 +0000 (16:12 +0200)] 
cal: non-ANSI definition [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoblkid: potential null derefence [smatch scan]
Karel Zak [Mon, 12 Sep 2011 14:10:45 +0000 (16:10 +0200)] 
blkid: potential null derefence [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: previously assumed null pointer [smatch scan]
Karel Zak [Mon, 12 Sep 2011 14:01:42 +0000 (16:01 +0200)] 
libmount: previously assumed null pointer [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agokill: potential null derefence [smatch scan]
Karel Zak [Mon, 12 Sep 2011 13:40:24 +0000 (15:40 +0200)] 
kill: potential null derefence [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: potential null derefence [smatch scan]
Karel Zak [Mon, 12 Sep 2011 13:35:33 +0000 (15:35 +0200)] 
libmount: potential null derefence [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: variable dereferenced before check [smatch scan]
Karel Zak [Mon, 12 Sep 2011 13:33:04 +0000 (15:33 +0200)] 
libmount: variable dereferenced before check [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: redundant null check on calling free() [smatch scan]
Karel Zak [Mon, 12 Sep 2011 13:32:35 +0000 (15:32 +0200)] 
libmount: redundant null check on calling free() [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: use unsigned int for bitfields [smatch scan]
Karel Zak [Mon, 12 Sep 2011 13:28:42 +0000 (15:28 +0200)] 
libmount: use unsigned int for bitfields [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibblkid: remove unnecessary position check from list_for_each_safe loops
Karel Zak [Mon, 12 Sep 2011 13:22:51 +0000 (15:22 +0200)] 
libblkid: remove unnecessary position check from list_for_each_safe loops

The position pointer is dereferenced before the check in the
for() in the list_for_each_safe macro.

Note that struct list_head should not contain NULL pointers. See
INIT_LIST_HEAD() macro.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: don't use full paths for smatch
Karel Zak [Mon, 12 Sep 2011 12:46:35 +0000 (14:46 +0200)] 
build-sys: don't use full paths for smatch

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoagetty: add --nohints
Karel Zak [Mon, 12 Sep 2011 12:24:27 +0000 (14:24 +0200)] 
agetty: add --nohints

Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: use --enable-most-builds for distcheck
Karel Zak [Mon, 12 Sep 2011 12:12:43 +0000 (14:12 +0200)] 
build-sys: use --enable-most-builds for distcheck

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoinclude,c.h: include fcntl.h before check for O_CLOEXEC [smatch scan]
Karel Zak [Mon, 12 Sep 2011 11:53:10 +0000 (13:53 +0200)] 
include,c.h: include fcntl.h before check for O_CLOEXEC [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: add checksmatch target
Karel Zak [Mon, 12 Sep 2011 11:52:14 +0000 (13:52 +0200)] 
build-sys: add checksmatch target

13 years agolscpu: remove unneeded file
Heiko Carstens [Sun, 11 Sep 2011 06:23:35 +0000 (08:23 +0200)] 
lscpu: remove unneeded file

As noted by Sami I accidentally added a garbage file.
Just remove it again.

Cc: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 years agofdformat: fix uninitialized variable
Francesco Cosoleto [Sat, 10 Sep 2011 17:06:09 +0000 (19:06 +0200)] 
fdformat: fix uninitialized variable

Spotted by EKOPath compiler.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agoMerge branch 'smatch' of https://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Mon, 12 Sep 2011 10:42:46 +0000 (12:42 +0200)] 
Merge branch 'smatch' of https://github.com/kerolasa/lelux-utiliteetit

* 'smatch' of https://github.com/kerolasa/lelux-utiliteetit:
  kill: fix issue warned by smatch
  last: fix smatch warning
  libblkid: fix smatch warning
  column: fix error reported by smatch
  build-sys: ddate typo fixed
  build-sys: add --enable-most-builds

13 years agolscpu: s/Y/Yes/ s/N/No/
Heiko Carstens [Sat, 10 Sep 2011 10:25:04 +0000 (12:25 +0200)] 
lscpu: s/Y/Yes/ s/N/No/

However I'd like to see one change if you don't object: printing just "N" or
"Y" instead of "No" and "Yes" in the human readable output looks a bit ugly to
me.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 years agosetarch: add version printing
Sami Kerola [Sun, 28 Aug 2011 10:04:15 +0000 (12:04 +0200)] 
setarch: add version printing

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agosetarch: use program_invocation_short_name
Sami Kerola [Sun, 28 Aug 2011 10:01:51 +0000 (12:01 +0200)] 
setarch: use program_invocation_short_name

Trust that the c.h is setting program name correctly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agosetarch: move options struct to function scope
Sami Kerola [Sun, 28 Aug 2011 10:01:09 +0000 (12:01 +0200)] 
setarch: move options struct to function scope

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agokill: fix issue warned by smatch
Sami Kerola [Sat, 10 Sep 2011 14:50:47 +0000 (16:50 +0200)] 
kill: fix issue warned by smatch

misc-utils/procs.c +82 get_pids(52) error: potential null derefence 'pids'.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agolast: fix smatch warning
Sami Kerola [Sat, 10 Sep 2011 14:49:58 +0000 (16:49 +0200)] 
last: fix smatch warning

login-utils/last.c +447 ttyconv(11) error: buffer overflow '(arg)' 3 <= 3

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agolibblkid: fix smatch warning
Sami Kerola [Sat, 10 Sep 2011 14:49:03 +0000 (16:49 +0200)] 
libblkid: fix smatch warning

libblkid/src/probe.c +798 blkid_probe_get_idmag(32) error: we previously assumed 'id' could be null.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agocolumn: fix error reported by smatch
Sami Kerola [Sat, 10 Sep 2011 14:48:12 +0000 (16:48 +0200)] 
column: fix error reported by smatch

column.c:201:2: error: 'for' loop initial declarations are only allowed in C99 mode

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agobuild-sys: ddate typo fixed
Sami Kerola [Sat, 10 Sep 2011 08:38:05 +0000 (10:38 +0200)] 
build-sys: ddate typo fixed

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agobuild-sys: add --enable-most-builds
Sami Kerola [Sat, 10 Sep 2011 14:46:53 +0000 (16:46 +0200)] 
build-sys: add --enable-most-builds

The --enable-most-builds will build everything else but
experimental code.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agolib,cpuset: fix compiler warning [-Wuninitialized]
Karel Zak [Fri, 9 Sep 2011 22:02:00 +0000 (00:02 +0200)] 
lib,cpuset: fix compiler warning [-Wuninitialized]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agochcpu,cpuset: reduce code duplication for cpu list parsing
Heiko Carstens [Fri, 9 Sep 2011 09:19:34 +0000 (11:19 +0200)] 
chcpu,cpuset: reduce code duplication for cpu list parsing

Reduce code duplication and print better error message if an
unsupported cpu number was passed.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 years agolib,cpuset: enforce stricter parsing of cpu lists
Heiko Carstens [Fri, 9 Sep 2011 09:19:33 +0000 (11:19 +0200)] 
lib,cpuset: enforce stricter parsing of cpu lists

The current cpulist_parse() function ignores extra non-parsable characters at
the end of the to be parsed cpu list string.  E.g. it would accept something
like "0bla" and just set bit 0 in the cpu set.  Since such a string is invalid
implement stricter parsing that makes sure that everything of the string has
been succesfully parsed.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 years agolib,cpuset: fix stride handling in cpulist_parse()
Heiko Carstens [Fri, 9 Sep 2011 09:19:32 +0000 (11:19 +0200)] 
lib,cpuset: fix stride handling in cpulist_parse()

If cpulist_parse() gets passed a cpu list with a stride value of 0 it will be
stuck in an endless loop.  E.g. the following cpu list will cause an endless
loop: "0-2:0".  Fix this by causing a parse error if the stride value is 0.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 years agolib,cpuset: fix odd placed braces in cpulist_parse()
Heiko Carstens [Fri, 9 Sep 2011 09:19:31 +0000 (11:19 +0200)] 
lib,cpuset: fix odd placed braces in cpulist_parse()

The opening and closing braces for two following if statements within
cpulist_parse() are placed in an odd manner.
Just fix this to prevent broken code in the future.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 years agolib,cpuset: fix comments for cpu mask/list functions
Heiko Carstens [Fri, 9 Sep 2011 09:19:30 +0000 (11:19 +0200)] 
lib,cpuset: fix comments for cpu mask/list functions

The comments for cpumask_parse() and cpulist_parse() each describe
the wrong function. Just exchange the comments.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 years agomount: remove superfluous "an" under ext4 mount options in mount.8
Frederik \"Freso\" S. Olesen [Wed, 7 Sep 2011 21:02:19 +0000 (23:02 +0200)] 
mount: remove superfluous "an" under ext4 mount options in mount.8

Signed-off-by: Frederik "Freso" S. Olesen <freso@freso.dk>
13 years agolscpu: add Hypervisor to output
Heiko Carstens [Tue, 6 Sep 2011 00:53:02 +0000 (02:53 +0200)] 
lscpu: add Hypervisor to output

Some vendors have several hypervisors. Therefore it makes sense to not only
print out the hypervisor vendor but also the name of the hypervisor.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolscpu: add s390 test case
Heiko Carstens [Tue, 6 Sep 2011 00:53:01 +0000 (02:53 +0200)] 
lscpu: add s390 test case

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 years agolscpu: add --online option
Karel Zak [Fri, 9 Sep 2011 20:59:47 +0000 (22:59 +0200)] 
lscpu: add --online option

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolscpu: add --all option
Heiko Carstens [Tue, 6 Sep 2011 00:53:00 +0000 (02:53 +0200)] 
lscpu: add --all option

The parsable output includes only lines of online CPUs. To also include
lines for all offline CPUs the "--all" option can be specified.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 years agolscpu: add online state to output
Heiko Carstens [Tue, 6 Sep 2011 00:52:59 +0000 (02:52 +0200)] 
lscpu: add online state to output

lscpu only prints lines for online CPUs. At least for the human readable
list the offline CPUs are of interest as well. In order to distinguish
between online and offline CPUs introduce the "Online" column.
By default the human readable output now displays online and offline CPUs.
The parsable output is not changed. It will print only lines for online
CPUs as it used to do.

[kzak@redhat.com: - minor changes]

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolscpu: add configured state to output
Heiko Carstens [Tue, 6 Sep 2011 00:52:58 +0000 (02:52 +0200)] 
lscpu: add configured state to output

CPUs may be in a configured or deconfigured state depending if the CPU resource
may be used by the guest.  If a CPU is in configured state the guest may use it
(i.e. set it online). It it is in deconfigured state it cannot use it before
changing its state to configured.  Display this CPU attribute as well.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 years agolscpu: add human readable extended cpu table output
Karel Zak [Fri, 9 Sep 2011 18:59:59 +0000 (20:59 +0200)] 
lscpu: add human readable extended cpu table output

Based on patch from Heiko Carstens <heiko.carstens@de.ibm.com>:

lscpu currently only supports a parsable output which contains a row for
each cpu and its attributes. This output contains only comas as separators
and is hard to read for humans.

Therefore add a new option "-e | --extended" which outputs the rows in a
much more readable (and non-parsable) form. Just like for the -p option a
list of columns can be specified that shall be included in the output.

By default this option will print all columns that contain data.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolscpu: use buffer for data and headers
Karel Zak [Fri, 9 Sep 2011 18:08:52 +0000 (20:08 +0200)] 
lscpu: use buffer for data and headers

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolscpu: use function to search in cpu masks arrays
Karel Zak [Fri, 9 Sep 2011 06:19:24 +0000 (08:19 +0200)] 
lscpu: use function to search in cpu masks arrays

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolscpu: cleanup output modes
Karel Zak [Fri, 9 Sep 2011 05:25:21 +0000 (07:25 +0200)] 
lscpu: cleanup output modes

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolscpu: add --version option
Heiko Carstens [Tue, 6 Sep 2011 00:52:56 +0000 (02:52 +0200)] 
lscpu: add --version option

Add a --version option like most other tools have it.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolscpu: allow read_cache() to be called for offline cpus
Heiko Carstens [Tue, 6 Sep 2011 00:52:55 +0000 (02:52 +0200)] 
lscpu: allow read_cache() to be called for offline cpus

First check path before accessing files to be sure they actually exist. This is
necessary when also informations for offline CPUs will be printed.  Since we do
not necessarily know if "cpu is offline" means the same as "path does not
exist" just check for it.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 years agolscpu: simplify cache column output function
Heiko Carstens [Tue, 6 Sep 2011 00:52:54 +0000 (02:52 +0200)] 
lscpu: simplify cache column output function

Simplify the logic to "always print a ',' for each cache except if it is the
last one.  This is also a preparation patch for printing the cache column for
offline CPUs where it would print one colon too much because of the current
logic.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 years agolscpu: fix cache output for extended parsable output
Heiko Carstens [Tue, 6 Sep 2011 00:52:53 +0000 (02:52 +0200)] 
lscpu: fix cache output for extended parsable output

The extended parsable output prints a colon instead of comma between each
item. The case where a CPU doesn't belong to any cache was not converted.
Just fix this.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 years agolscpu: remove comma operator
Heiko Carstens [Tue, 6 Sep 2011 00:52:52 +0000 (02:52 +0200)] 
lscpu: remove comma operator

Fix typo where the comma operator has been introduced.
Use a semicolon instead so we end up with simple assignment expressions.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 years agomount: fix compiler warning [-Wunused-parameter]
Karel Zak [Thu, 8 Sep 2011 17:54:22 +0000 (19:54 +0200)] 
mount: fix compiler warning [-Wunused-parameter]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodmesg: add --file option
Karel Zak [Thu, 8 Sep 2011 17:40:34 +0000 (19:40 +0200)] 
dmesg: add --file option

This new option is mostly for testing (to test raw logs from another
boxes/kernels).

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoscript: libintl.h included in nls.h
Karel Zak [Wed, 7 Sep 2011 14:29:56 +0000 (16:29 +0200)] 
script: libintl.h included in nls.h

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibblkid: DRBD proxy data-log identification.
Philipp Marek [Wed, 31 Aug 2011 07:41:01 +0000 (09:41 +0200)] 
libblkid: DRBD proxy data-log identification.

Signed-off-by: Philipp Marek <philipp.marek@linbit.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibblkid: new magic for 8.4 style (unclean) activity log.
Philipp Marek [Thu, 1 Sep 2011 12:16:21 +0000 (14:16 +0200)] 
libblkid: new magic for 8.4 style (unclean) activity log.

Signed-off-by: Philipp Marek <philipp.marek@linbit.com>
13 years agolibuuid: add limits.h include for OPEN_MAX
maximilian attems [Tue, 6 Sep 2011 22:41:25 +0000 (00:41 +0200)] 
libuuid: add limits.h include for OPEN_MAX

Needed as definition for usage in close_all_fds().
Noticed on klibc build.

Signed-off-by: maximilian attems <max@stro.at>
13 years agoagetty: double equals sign typo in opentty()
Karel Zak [Wed, 7 Sep 2011 05:37:03 +0000 (07:37 +0200)] 
agetty: double equals sign typo in opentty()

Reported-by: Francesco Cosoleto <cosoleto@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoscript: fix building with --disable-nls
Natanael Copa [Tue, 30 Aug 2011 11:50:28 +0000 (11:50 +0000)] 
script: fix building with --disable-nls

We should only include the libintl.h when NLS is requested.

This fixes issue when building util-linux with uClibc.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
13 years agowrite: fix path for freopen()
Karel Zak [Tue, 6 Sep 2011 01:18:46 +0000 (03:18 +0200)] 
write: fix path for freopen()

Reported-by: xinglp <xinglp@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodmesg: remove extra space only after time stamp
Karel Zak [Fri, 2 Sep 2011 12:42:04 +0000 (14:42 +0200)] 
dmesg: remove extra space only after time stamp

Signed-off-by: Karel Zak <kzak@redhat.com>