Sami Kerola [Sat, 26 Feb 2011 14:37:17 +0000 (15:37 +0100)]
build-sys: use AC_LANG_SOURCE to suppress warnings
Messages bellow be supressed by using AC_LANG_SOURCE macro around
code test blocks.
m4/tls.m4:13: AX_CHECK_TLS is expanded from...
configure.ac:335: the top level
configure.ac:335: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2660: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2677: AC_LINK_IFELSE is expanded from...
../../lib/m4sugar/m4sh.m4:605: AS_IF is expanded from...
../../lib/autoconf/general.m4:2728: _AC_RUN_IFELSE is expanded from...
../../lib/m4sugar/m4sh.m4:605: AS_IF is expanded from...
../../lib/autoconf/general.m4:2747: AC_RUN_IFELSE is expanded from...
../../lib/m4sugar/m4sh.m4:605: AS_IF is expanded from...
../../lib/autoconf/general.m4:2030: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2051: AC_CACHE_CHECK is expanded from...
m4/tls.m4:13: AX_CHECK_TLS is expanded from...
configure.ac:335: the top level
Reference to documentation;
http://www.flameeyes.eu/autotools-mythbuster/forwardporting/autoconf.html#id1168723648533
raw: remove constants from message strings; undo some abbrevs
Having a constant embedded within a message string prevents gettext from
picking up the rest of the string. Also, translators may wish to change
word order; using a constant as a prefix or postfix makes this impossible.
Sami Kerola [Thu, 24 Feb 2011 19:15:43 +0000 (20:15 +0100)]
fsck: fix clang compiler warning
fsck.c:874:22: warning: format string is not a string literal
(potentially insecure) [-Wformat-security]
errx(EXIT_USAGE, _(fs_type_syntax_error));
^~~~~~~~~~~~~~~~~~~~~~~
The issue was introduced in my commit 0a09eb4e, sorry.
Daniel Drake [Mon, 21 Feb 2011 13:27:07 +0000 (13:27 +0000)]
hwclock: make RTC default to UTC time
If /etc/adjtime doesn't specify UTC or LOCAL, rtcwake defaults to UTC
and hwclock defaults to LOCAL.
Switch hwclock to meet the behaviour of rtcwake (default=UTC), also
matching the kernel's CONFIG_RTC_HCTOSYS behaviour.
The user impact of this change should be minimal, as anyone who has run
"hwclock --systohc" before will have their UTC/LOCAL choice already
recorded in /etc/adjtime.
Sami Kerola [Sat, 19 Feb 2011 23:00:42 +0000 (00:00 +0100)]
doc: mention mkswap long options in man page
The update will also expand kernel version numbers to have a
month and year next to them. This should help users can get idea
how long, for example, swap v1 has been around.
[kzak@redhat.com: - modify synopsis, remove duplicate info about page size]
Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Petr Uzel [Thu, 17 Feb 2011 11:52:43 +0000 (12:52 +0100)]
umount: allow unmounting loopdev specified by associated file
Make it possible to unmount a filesystem on a loop device if it is
specified by associated backing file. It does not attempt to unmount
anything if there are more than one loop device associated with the
given file.
Umount looks for associated loopdevice(s) only if umount is called
with the regular file as an argument.
Before:
mount -o loop -t ext2 img mnt
umount -v img
> Could not find /home/puzel/upstream/util-linux/img in mtab
> umount: img: not mounted
After:
mount -o loop -t ext2 img mnt
umount -v img
> img is associated with /dev/loop0, trying to unmount it
> /dev/loop0 has been unmounted
[kzak@redhat.com: - fix memory leak in lomount.c]
Addresses: https://bugzilla.novell.com/show_bug.cgi?id=666161 Signed-off-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
Sami Kerola [Sat, 12 Feb 2011 20:55:53 +0000 (21:55 +0100)]
hexdump: new usage(), xalloc and err.h stuff
New usage help screen and print version switch. Also fixes to
exit codes, util linux xmalloc replaced emalloc and every error
print is using libc error function.
[kzak@redhat.com: - minor changes in formatting and coding style]
Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Petr Uzel [Mon, 14 Feb 2011 13:43:29 +0000 (14:43 +0100)]
libuuid: introduce uuid_generate_time_safe()
The problem with libuuid interface is that it is impossible to
inform the caller of uuid_generate_time() if the UUID was generated
in a safe manner (either via uuidd, or using the global clock state
counter).
This patch introduces new function,
int uuid_generate_time_safe(uuid_t out)
which can report whether the generated UUID is safe.
Petr Uzel [Mon, 14 Feb 2011 13:43:27 +0000 (14:43 +0100)]
libuuid: rename uuid__generate_* to __uuid_generate_*
Having uuid_generate_time and uuid__generate_time at
the same time is confusing. These functions are exported,
but not part of the official API (used by uuidd only).
Sami Kerola [Wed, 16 Feb 2011 14:20:11 +0000 (15:20 +0100)]
fsck: use xmalloc, warn & err and new usage
All compler errors reported by -Wall -Wextra -pedantic are fixed.
The patch also makes fsck to use xalloc instead of it's own malloc.
That will make fsck to exit, which could be good thing, at sections
where it previously did not.
Almost all print outs where touched, where various printfs where
converted to warn or err messages.
Finally theres a fix to counter wrap bug that could (very unlikely)
manifest itself if an user specifies same flag exactly UINT_MAX times.
[kzak@redhat.com: - coding style
- define XALLOC_EXIT_CODE
- use verbose++ in main()]
Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Dave Reisner [Tue, 15 Feb 2011 09:06:08 +0000 (10:06 +0100)]
lib: [strutils] avoid integer overflow on large values
This is visible on a 2TB disk via lsblk, where a large partition
incorrectly displays as 1.171798692T instead of 1.8T. This is
corrected by using a uint64_t type instead of a simple int --
consistant with the type used in lsblk.c to represent the raw size in
bytes.
[kzak@redhat.com: - add EiB support
- add size_to_human_string() to regression tests]
Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Karel Zak <kzak@redhat.com>