Commit Graph

12864 Commits

Author SHA1 Message Date
Karel Zak f2538b6a86 tests: add cal --span tests
Addresses: https://github.com/karelzak/util-linux/issues/677
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-07 11:06:13 +02:00
Karel Zak 549281cb87 tests: check for test_cal
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-07 10:59:06 +02:00
Karel Zak 2395f93c8c cal: fix --span for large numbers of months
The need to calculate with whole years when go back for --span.

Addresses: https://github.com/karelzak/util-linux/issues/677
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-07 10:52:33 +02:00
Karel Zak 100a140688 cal: use snprintf everywhere
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-07 10:15:42 +02:00
Karel Zak 1db8bf9378 setarch: split set_arch() function to small functions
It seems better to keep the code more flexibile by small one-purpose
functions than by one huge monster.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-06 16:32:36 +02:00
Bjarni Ingi Gislason 41f22ff389 agetty.8: Avoid a warning about an unbreakable line
Make the indent depend on the formatting command, nroff or troff.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2018-08-06 08:58:57 +02:00
Bjarni Ingi Gislason 559ee54af1 man pages: Fix misuse of two-fonts-macros (BR, IR)
Change a two-fonts-macro to the single font one, when there is only
one genuine argument.

  Split a punctuation mark from the only argument to a two-fonts-marco.

  Remove an isolated two-fonts-macro.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2018-08-06 08:58:57 +02:00
Bjarni Ingi Gislason 62aa3f0eaf man pages: fix formatting of long lines in tables
Define the allowed length of the last (second) column to use the
whole line for text.

  Use text blocks for long lines.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2018-08-06 08:58:57 +02:00
Bjarni Ingi Gislason 934a6fa80b man pages: Remove "left" (or change to "l") in the column formats of tables
A developmental version of "groff" issued a warning, for example with
"test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z":

troff: <logger.1>:299: warning: can't find font 't'

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2018-08-06 08:58:57 +02:00
Karel Zak 0dc7598323 su: add note about SIGKILL to the man page
Addresses: https://github.com/karelzak/util-linux/issues/443
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-03 14:08:00 +02:00
Karel Zak 01041a9d1d Merge branch 'patch-1' of https://github.com/pmarillo/util-linux
* 'patch-1' of https://github.com/pmarillo/util-linux:
  Fix translation typo
2018-08-03 13:19:51 +02:00
Karel Zak 0dcb713f2e hwclock: rely on kernel for RTC_UIE_ON on Aplha and Sparc
It's kernel business to return EINVAL for unsupported RTC_UIE_ON. We
(userspace) should not make decisions about things that we do not
control.

If kernel is wrong then fix the kernel, don't hide the problem by
crazy ifdefs in userspace.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-03 13:08:21 +02:00
Sami Kerola 8dd5832395 mesg: do not print 'ttyname failed' message unless --verbose requested
Lots of people are confused why mesg(1) is priting this message.  Usual
cause seems to be an uninteractive shell trying to turn running 'mesg n'
from a /root/.profile where command invocation is by default on debian based
systems.  This might be rare case when failing silently is better.

[kzak@redhat.com: - add note to the man page
                  - fix if(isatty()) logic]

Reference: https://www.google.com/search?q=mesg+ttyname+failed
Review: https://marc.info/?l=util-linux-ng&m=153319988631233&w=2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-03 12:27:02 +02:00
Paul M 924888cb90
Fix translation typo 2018-08-03 09:58:54 +02:00
Karel Zak c6789d37ea tests: update lscpu tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-01 12:09:09 +02:00
Karel Zak dbcd1a4964 fdisk: fix error message on 'd' command
Command (m for help): d
	No partition is defined yet!
	Could not delete partition 93840461057817    <--- !

Don't print 'Could not delete..' if no partition is defined yet.

Addresses: https://github.com/karelzak/util-linux/issues/667
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-01 09:29:12 +02:00
Karel Zak d5fd9ac6b2 umount: add --quiet option
The command umount supports things like --all-targets and --recursive
to umount all nodes in specified tree. Sometimes it makes sense to
aggressively use wildcards like /dev/sdb* and in this case --quiet
seems like a good choice

	umount --quiet --all-targets /dev/sdb*

to suppress 'not mounted' error messages. The new option suppress only
these error messages and nothing else.

Addresses: https://github.com/karelzak/util-linux/issues/672
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-01 09:10:07 +02:00
Karel Zak 3e48ef72c1 lscpu: add 'Address sizes'
Addresses: https://github.com/karelzak/util-linux/issues/674
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-01 08:33:32 +02:00
Karel Zak c5b8909f13 fstrim: add -A|--fstab to trim according to /etc/fstab
Addresses: https://github.com/karelzak/util-linux/issues/673
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-31 16:38:59 +02:00
Karel Zak 72213916c3 fstrim: add control struct
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-31 15:58:49 +02:00
Karel Zak d68588b0c6 tests: update fdisk dialogs
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-31 15:20:55 +02:00
Awal Garg 757cefbb61 libfdisk: Accept negative numbers for last sector input
[kzak@redhat.com: - add note to the man page
                  - add '-' to the dialog query
                  - cleanup functions names and libfdisk.sym]

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-31 14:54:12 +02:00
Karel Zak 6df5c6d4e0 hwclock: remove ntpd from man page
It seems better to use generic "NTP daemon" in the man page than
points to specific ntpd(1) implementation as some distros use for
example chronyd(1) rather than old ntpd(1).

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-31 11:07:47 +02:00
Karel Zak d29b7ced3b lscpu: fix resource leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-25 12:02:28 +02:00
Karel Zak 9c6af25c31 losetup: fix mem leak, improve code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-25 11:56:44 +02:00
Karel Zak f665f6e43c libblkid: use xstrncpy() for PT id [coverity scan]
It's probably unnecessary change as blkid_parttable_set_id() is used
by MBR code and we use proper buffer size there, but better safe than
sorry.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-25 11:25:33 +02:00
Karel Zak e236f61d7c docs: add note about --disable-all-programs
Addresses: https://github.com/karelzak/util-linux/issues/666
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-24 12:35:45 +02:00
Karel Zak f2cfb2351a cfdisk: fix compiler warnings [-Wcast-qual]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-23 13:08:56 +02:00
Karel Zak e736434bc8 blkid: fix compiler warnings [-Wcast-qual]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-23 12:30:37 +02:00
Karel Zak 088d487612 login: use const qualifier for username from PAM or struct passwd [-Wcast-qual]
It seems more robust to use 'const' qualifier for username if this
variable points to external resources like PAM or struct passwd. The
patch introduces new variable cmd_username for username specified on
login(1) command line.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-23 12:21:33 +02:00
Karel Zak 9c566fce79 libmount: (utils) fix compiler warnings [-Wcast-qual]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-23 11:58:57 +02:00
Karel Zak 892fc7d9de lib/colors:: fix compiler warnings [-Wcast-qual]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-23 11:55:25 +02:00
Karel Zak 0f9b25958e setterm: fix compiler warnings [-Wcast-qual]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-23 11:49:49 +02:00
Karel Zak df3bc05a7f setterm: fix compiler warnings [-Wcast-qual]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-23 11:45:15 +02:00
Karel Zak 58bc493243 swapon: fix compiler warnings [-Wcast-qual]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-23 11:43:47 +02:00
Karel Zak f11157e804 mkswap: fix compiler warnings [-Wcast-qual]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-23 11:43:30 +02:00
Karel Zak ec4b88b83d libfdisk: fix compiler warnings [-Wcast-qual]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-23 11:39:13 +02:00
Karel Zak b00dd55ac8 libmount: fix compiler warning [-Wcast-qual]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-23 11:33:13 +02:00
Karel Zak 0145c00a12 lib/loopdev: fix compiler warning [-Wcast-qual]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-23 11:17:28 +02:00
Karel Zak 78c66fc61d lib/mangle: const quialifier cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-20 15:31:42 +02:00
Karel Zak eb06d5d4b2 include/list, include/c: update and container_of()
* update container_of() to version without "const" qualifier

* use container_of() in list_entry()

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-20 15:22:35 +02:00
Karel Zak 47afae0caa libblkid: const qualifier cleanup
* use "const" in functions where we don't modify arguments

* use "const" when cast from const buffer to any struct (superblock etc.)

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-20 15:05:32 +02:00
Karel Zak 34708190d1 include/all-io: const cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-20 14:53:25 +02:00
Karel Zak ea927bde6b libmount: cleanup const in umount code
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-20 14:15:42 +02:00
Karel Zak c8b237a0ed lib/color-names: const cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-20 13:58:10 +02:00
Karel Zak a679b0823f libmount: add missing const
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-20 13:51:52 +02:00
Karel Zak 0d1e744c20 libmount: use const char in swaps parser
The parser does not modify the string, so let's keep it "const char".

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-20 13:49:08 +02:00
Karel Zak 4e4c9629e6 libmount: use const char in mountinfo parser
The parser does not modify the string, so let's keep it "const char".

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-20 13:48:09 +02:00
Karel Zak 4ccc64c4ca libmount: use const char in fstab parser
The parser does not modify the string, so let's keep it "const char".

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-20 13:44:53 +02:00
Karel Zak d54b83156f lib/strutils: follow const in parse_size()
* don't cast from char to const char

* don't share endptr from strtoxxx() with rest of the code
  as the end pointer is char, but code works with const chars

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-20 12:54:58 +02:00