Commit Graph

1598 Commits

Author SHA1 Message Date
Karel Zak dcc3b1fc2e umount: add man page note that --force is not perfect
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-17 12:19:31 +01:00
Benno Schulenberg 49b7f95e43 docs: miscellaneous tiny tweaks of man pages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-17 12:18:54 +01:00
Benno Schulenberg afaf31035d unshare: describe the setgroups restriction more explicitly
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-17 12:18:53 +01:00
Benno Schulenberg e71040ce58 lscpu: improve spacing and spelling in the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-17 12:18:52 +01:00
Ruediger Meier e5fc6d6fb5 lscpu: fix memleak because of ambiguous tags
Now the first one of certain ambiguous tags wins. Alternatively to
this patch we could have called free() before xstrdup().

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-16 14:17:34 +01:00
Ruediger Meier c95e388972 lscpu: use cpu and revision tag if available
Avoid ifdef which does not work with --sysroot. Our existing test
dumps produce even better output now for ppc and sparc.

The logic moved to the printing section.

CC: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-16 14:17:33 +01:00
Ruediger Meier 86c4817e0e Revert "lscpu: keep lscpu usable on snapshots"
This reverts commit 641350fe82.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-16 14:17:33 +01:00
Benno Schulenberg 0825fe1621 dmesg: improve grammar and consistency of usage text
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-16 10:39:39 +01:00
Benno Schulenberg b779c1aecb mount, umount, swapon, fsck, lsblk, findmnt: harmonize six error messages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-16 10:39:38 +01:00
Karel Zak 641350fe82 lscpu: keep lscpu usable on snapshots
This patch reverts 3ac03fe4d2 for
snapshots (--sysroot).

Yeah, poor-man solution. It would be really nice to have runtime
detection to support model overwriting also on snapshots.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-15 14:23:59 +01:00
Karel Zak 12f5cbe159 swapon: remove unnecessary assert
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818252
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-15 11:38:01 +01:00
Vasant Hegde 3ac03fe4d2 lscpu: Fix model and model name on Power Systems
On Power System, lspcu presently displays system model number instead of
processor model name. 'model' tag in cpuinfo contains system model name,
not processor model. Instead it uses 'cpu' tag for processor model name.
Also it uses 'revision' tag for processor model.

Fix lspcu so that it displays processor model number. Also display processor
model name.

cpuinfo output on Power System:
  ...
  ...

  processor	: 127
  cpu		: POWER8E (raw), altivec supported
  clock		: 4322.000000MHz
  revision	: 2.1 (pvr 004b 0201)

  timebase	: 512000000
  platform	: PowerNV
  model		: 8286-42A
  machine	: PowerNV 8286-42A
  firmware	: OPAL

Output without this patch:
  Architecture:          ppc64le
  Byte Order:            Little Endian
  CPU(s):                128
  On-line CPU(s) list:   0-127
  Thread(s) per core:    8
  Core(s) per socket:    4
  Socket(s):             4
  NUMA node(s):          4
  Model:                 8286-42A
  ...
  ...

Output with this patch:
  Architecture:          ppc64le
  Byte Order:            Little Endian
  CPU(s):                128
  On-line CPU(s) list:   0-127
  Thread(s) per core:    8
  Core(s) per socket:    4
  Socket(s):             4
  NUMA node(s):          4
  Model:                 2.1 (pvr 004b 0201)
  Model name:            POWER8E (raw), altivec supported
  ...
  ...

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2016-03-14 16:17:19 +01:00
Karel Zak 79d8593fd7 unshare: tiny change
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-14 16:15:04 +01:00
Karel Zak 0ed6e43925 unshare: fix incomplete sentence in man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-14 16:13:23 +01:00
Benno Schulenberg de0f3763c7 unshare: improve wording and formatting in the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-14 16:11:09 +01:00
Benno Schulenberg 99b3fb9eba unshare: replace a special character in the man page with a space
Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-14 16:11:05 +01:00
Benno Schulenberg 47f9b35ef4 fallocate: improve synopsis and spelling in man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-14 16:11:04 +01:00
Benno Schulenberg 0167ca8215 fallocate: restore man-page content that was deleted in commit 5b033bfd
Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-14 16:11:02 +01:00
Karel Zak 785539baa3 Merge branch 'travis-osx' of https://github.com/rudimeier/util-linux
* 'travis-osx' of https://github.com/rudimeier/util-linux:
  travis: add OSX build
  travis: switch to Ubuntu 14.04 Trusty
  build-sys: improve uuidd and script build conditions
  build-sys: use AC_PROG_MKDIR_P and remove a few gnuisms
  build-sys: add missing "not found" strings
  build-sys: fix again UL_SCANF_TYPE_MODIFIER
  tests: don't use system's mount commands
  tests: improve skipping of old btrfs-tools
  tests: remove invalid argument in libmount/debug
  tests: skip old socat silently
  misc: fix icc/clang compiler warnings
  misc: fix printf i386 compiler warnings
2016-03-14 15:59:10 +01:00
Sami Kerola aeb9298d3e setsid: fix argument count bug
The below demonstrates what happen before this change.

$ setsid --wait
setsid: child 3252 did not exit normally: Success

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-03-14 13:15:13 +01:00
Richard Yao 1d01d13eda swapon: fix discard=pages docs
The documentation for discard=pages is ambiguous in that it could be
interpreted to mean either that the pages are discarded immediately
after being freed or that the pages are discarded immediately before
being reused by a write. Both implementations would satisfy the
statement "discard freed swap pages before they are avaliable for
reuse", but the kernel does the former.

Doing a discard operation (which is non-queued on SATA drives before
SATA 3.1) before a write operation to the same sector is pointless
unless using, pre-SATA 3.1 drives, where discard is detrimental because
ATA TRIM is a non-queued command.

Anyone who wants discard operations on swap and interprets the man page
as describing the incorrect behavior would opt for discard=once over
discard, when discard provides the behavior of both discard=once and
discard=pages, which is what they likely want.

Lets make a small change to the documentation to clarify the behavior.

Signed-off-by: Richard Yao <ryao@gentoo.org>
2016-03-14 12:26:28 +01:00
Ruediger Meier 18336d16d9 build-sys: use AC_PROG_MKDIR_P and remove a few gnuisms
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-13 21:48:09 +01:00
Ruediger Meier e1a15f8f68 misc: fix printf i386 compiler warnings
Still a few printf warnings found on i386 Linux:

libfdisk/src/alignment.c: In function 'fdisk_align_lba':
libfdisk/src/alignment.c:115:3: warning: format '%ju' expects argument of type 'uintmax_t', but argument 6 has type 'long unsigned int' [-Wformat]
sys-utils/lsns.c: In function ‘add_namespace’:
sys-utils/lsns.c:346:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘ino_t’ [-Wformat]
sys-utils/lsns.c: In function ‘add_process_to_namespace’:
sys-utils/lsns.c:362:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘ino_t’ [-Wformat]
sys-utils/lsns.c: In function ‘add_scols_line’:
sys-utils/lsns.c:440:4: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘ino_t’ [-Wformat]

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-12 11:28:03 +01:00
Benno Schulenberg b31fd516ff blkdiscard: slice up the recently changed usage text
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-09 12:11:18 +01:00
Benno Schulenberg 8142133441 mount: further improve formatting of the man page
Mainly by using proper subsections (so they can be indexed),
protecting some things from hyphenation, and marking with \&
periods that don't end sentences.  Tweaking some wordings too.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-09 12:10:52 +01:00
Karel Zak 3fe3f560b7 Revert "include sysmacros.h where used"
This reverts commit 46a40c0184.
2016-03-08 14:26:33 +01:00
Benno Schulenberg bcdf097812 mount: adjust some wordings and formatting in the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-08 14:21:55 +01:00
Benno Schulenberg c3cd675108 ctrlaltdel: tweak the wording in the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-08 14:21:55 +01:00
Benno Schulenberg 289619bdb6 losetup: correct some formatting in the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-08 14:21:55 +01:00
Benno Schulenberg bed9c1f5e5 mount: hardwrap an overlong example in the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-08 14:21:55 +01:00
Benno Schulenberg bbe6f3cf39 fstrim: a few tiny tweaks of the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-08 14:21:55 +01:00
Mike Frysinger 46a40c0184 include sysmacros.h where used
BSD/Linux systems stick major/minor/makedev in sysmacros.h.  Newer Linux
libraries have been moving away from including sysmacros.h implicitly via
sys/types.h, so include it directly.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2016-03-08 14:21:55 +01:00
Ruediger Meier fea1cbf748 misc: never cast void* from malloc(3) and friends
Such cast could hide serious compiler warnings in case we are
missing includes (e.g. <stdlib.h> or "xalloc.h").

See
http://stackoverflow.com/questions/605845/do-i-cast-the-result-of-malloc

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-07 23:29:27 +01:00
Yuriy M. Kaminskiy 06fa581748 misc: safer (and uniform) handling of return value
When `rc` is `INT_MAX`, `rc + 1` result in signed integer overflow.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-07 15:11:06 +01:00
Yuriy M. Kaminskiy ff27b20f3c lsns.c: fix error return
If non-negative value returned, errno could be unset (especially 0).


Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-07 15:11:06 +01:00
Yuriy M. Kaminskiy 0c5bbafaf9 lscpu: fix backward buffer size adjustment after adding delimiter
remaining buffer space was increased after adding character, instead
of decreasing

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-07 15:10:46 +01:00
Karel Zak bcceb0c7dd Merge branch 'port-osx' of https://github.com/rudimeier/util-linux
* 'port-osx' of https://github.com/rudimeier/util-linux:
  lib: include strutils.h for mempcpy()
  build-sys: remove duplicate cal sources
  lib: provide fallback if mkostemp(3) missing
  build-sys: chrt requires a sched_set* function
  build-sys: add --disable-ipcrm --disable-ipcs
  build-sys: disable login-utils if shadow.h or utmp.h is missing
  login-utils: minor utmp cleanup
  build-sys: build_init should check for flock
  newgrp: rename memset_s()
  misc: fix some includes
  libsmartcols: fix uninitialized variable
  fdisk: fix warning, incompatible pointer types passing 'uint64_t *'
  logger: use SCM_CREDENTIALS on LINUX only
2016-03-07 14:37:31 +01:00
Dmitry V. Levin ae7065760d setarch: fix personality syscall return code check
Depending on architecture and kernel version, personality
syscall is either capable or incapable of returning an error.
If the return value is not an error, then it's the previous
personality value, which can be an arbitrary value
undistinguishable from an error value.
To make things clear, a second call is needed.

For more details about personality syscall peculiarities see
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=glibc-2.22-637-ge0043e17dfc5

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2016-03-07 14:23:21 +01:00
Ruediger Meier eaac9f88f9 misc: fix some includes
features.h:  any glibc header includes this already
libgen.h:    was unused there
sys/uio.h:   for writev(3p)
sys/queue.h  seems like it was never used

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-29 13:04:56 +01:00
Karel Zak 7154cc8926 blkdiscard: add --zeroout (BLKZEROOUT ioctl)
Requested-by: Yaniv Kaul <ykaul@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-24 15:21:38 +01:00
Karel Zak 249fc8fe89 unshare: add example for persistent mount namespace
References: https://github.com/karelzak/util-linux/issues/289
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-24 13:28:19 +01:00
Hushan Jia e0bbe3d6ff ipcs: show gid instead of uid
ipcs -i incorrectly used uid where it should be gid

Signed-off-by: Hushan Jia <hushan.jia@gmail.com>
2016-02-22 09:50:22 +01:00
Karel Zak a8b122f229 hwclock: use labs() for long
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-19 11:38:04 +01:00
Ruediger Meier 9d3d66dfaa lsns: use xcalloc()
... found by tools/checkxalloc.sh

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-18 16:54:26 +01:00
Ruediger Meier b0b24b11f8 lib: rename strmode() and setmode()
On BSD they are part of the standard C library.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-18 12:53:48 +01:00
Yuriy M. Kaminskiy 99fcafdf5f unshare: fix busyloop and reduce racing probability
Replace busy-loop with waiting on pipe from parent.

Note: reduces racing probability, but still there are window where
it is possible (if parent unshare process will be [externally] killed
between successful read(fds[0]) and mount() calls).

[kzak@redhat.com: - use all-io.h to avoid loops around write() and read(),
                  - use less generic 0x06 byte to sync parent and child]

Signed-off-by: Yuriy M. Kaminskiy <yumkam@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-17 13:54:56 +01:00
J William Piggott e05ac5aae0 hwclock.c, hwclock.8.in: new --show format
* hwclock.c: change --get and --show functions to the ISO 8601
  format and concatenate fractional seconds to the time display.

* hwclock.8.in: document this.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2016-02-16 19:37:32 -05:00
Ruediger Meier c211401801 misc: always cast timeval.tv_usec to long rather than int
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-12 14:32:42 +01:00
Ruediger Meier 8fe76cd171 ipcs: ulong -> unsigned long
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-11 12:31:03 +01:00
Karel Zak eac478dcfd swapon: drop perms if setuid before call mkswap
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-11 12:07:34 +01:00