The file is no portable (#ifdef HAVE_SYS_SYSMACROS_H is necessary),
but needed on many places. It seems better to keep it in c.h.
Signed-off-by: Karel Zak <kzak@redhat.com>
Use "when" as argument, to match the argument of --color,
that can have the same three values.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
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>
We don't control mount options in the mountinfo file and the options
depend on kernel version. It does not make sense to hardcode the
options in the expected outputs.
Note that libmount should be portable enough to be able to work with
all kernel versions. It seems better to check libmount functionality
than kernel mount options formatting.
Signed-off-by: Karel Zak <kzak@redhat.com>
BSD gets the program name for warnings from getprogname() and not
from argv. Thus we use setprogname() there.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Treat missing expected files as empty and let the test fail if
there is non-empty output.
Expected output may be missing in these cases:
1. forgot to commit the file after changing/adding a (sub)test
2. a bug in a test where we do tricks with TS_EXPECTED
3. and most notable if ts_die() is called before a subtest is
initialized, e.g. in ts_scsi_debug_init()
I always wondered why we don't treat this as FAILED. Now we do
so, ts_finalize and ts_gen_diff looks much cleaner now.
The change discovers that tests with subtest were ignoring the
"non-sub" expected files which had to be fixed. BTW we removed
any zero sized files.
Moreover now we respect diff's return value. In past all test
succeeded when diff was not able to write to diffdir, e.g. when
running tests as normal user after they run as root.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Sudo may login as group wheel or may use user's original group.
Note that group 0 is not named "root" on all Unix systems.
We have some more tests with similar issues but they are Linux-only
(losetup, scsi_debug). We don't fix them unless somebody complains.
BTW we use hexdump instead of md5sum.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This include was added just one month ago in 5a971329 but I don't see
what it was good for. It's missing in musl libc.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Linux/glibc's qsort_r(3) has differently ordered arguments than BSD
implementations. For now we undef that quick and dirty.
The real fix would be to make configure check for qsort_r more
carefully (AC_CHECK_FUNCS with AC_LANG_WERROR). Moreover one could
add a wrapper to swap arguments, see
https://github.com/noporpoise/sort_r/blob/master/sort_r.h
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* 'fix-minix' of https://github.com/rudimeier/util-linux:
tests: minix, add a useful non-root check
tests: fix minix tests for big endian
mkfs.minix: fix v2/v3 .badblocks inode number for big endian
fsck.minix: fix v3 version offset
tests: minix, some corrections and cleanup
tests: minix, use hexdump instead of md5sum
I have validated that we are still compatible at least back to
- openSUSE 11.4
- SLE 11
- RHEL/CentOS 6
- OSX 10.10.x, (Xcode 6.3)
- FreeBSD 10.2
Confirmed incompatibility:
- OSX 10.9.x, (Xcode 6.2)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Commit 42f15e9848 introduced a certain
inaccuracy in -c option description; it is not _the option with an argument_,
but it is the flag that changes interpretation of `mask` parameter.
The difference is almost not noticeable, but there are one corner case where it is:
taskset -c 1 -p $$
fails (but it would work if 42f15e was correct). Instead,
taskset -c -p 1 $$
works (but it should not have if 42f15e was correct).
Signed-off-by: Karel Zak <kzak@redhat.com>
While the header says C/H/S the actual numbers where printed as
C/S/H.
Addresses: http://bugs.debian.org/815847
Reported-by: "groups, freeman" <freeman_groups@reason.dyndns.org>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
* '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
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>
As documented in the manual and the usage info, the long options
--one-byte-char, --canonical, and --two-bytes-octal should not accept
any arguments.
Signed-off-by: Phil Ruffwind <rf@rufflewind.com>
This is to force the one-line results also for non-parallel case.
We are using it for travis auto-build and on other build farms.
Moreover you can set this (and any other) option globally by env
which is the only way to pass it to make distcheck.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Like in non-parallel case we are printing only one line per
(sub)test now. The output lines must contain the full test name
to be useful.
This patch does not change anything for the non-parallel output
format except a bit code cleanup.
BTW changed blkid/low-probe test description to have shorter
lines.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
For minix v2/v3 on big endian systems the inode number of the unwanted
".badblocks" file was not set to zero. This was introduced when v3 was
added in a2657ae3.
Actually it did not seem to cause any problems but since we zero it out
at all we should do it correctly. Now we zero out the whole directory
entry (inclusive ".badblocks" file name, also for v1). Unfortunately we
have to update the test data checksums.
CC: Davidlohr Bueso <davidlohr@hp.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Our test-suite discoverd it on big endian systems, but it was also
broken on little endian for inode numbers > 0xffff.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
- move generic "check_minix_fs_type" tests to the top
- add some todos/notes about potential issues
- add "real" badblocks test (-l)
- don't check sed's but fsck's return value
- to see debian bug 773892 we would need "-f"
- add some more hexdumps
CC: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
We have that mempcpy fallback since 2013 (02887b73) but forgot to
include it.
This fixes a segfault of cal(1) on FreeBSD and OSX.
Compiler warning was:
lib/mbsalign.c:468:14: warning: implicit declaration of function 'mempcpy' is invalid in C99 [-Wimplicit-function-declaration]
dest = mempcpy (dest, str_to_print, min (n_used_bytes, space_left));
^
lib/mbsalign.c:468:12: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
dest = mempcpy (dest, str_to_print, min (n_used_bytes, space_left));
CC: Daniel Trebbien <dtrebbien@gmail.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
These extra sources should have been removed since cal is
linked against libcommon (see 7b353df2).
CC: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>