build-sys: make the crosscompile path for scanf_cv_alloc_modifier clever
My earlier assumption was that scanf_cv_alloc_modifier is unused. This
is not true as pointed out by Karel since it used befoe checking for
libmount. Argh. So instead saying no I add a test to check for glibc
>= 2.7 which provides %m. As of uClibc v0.9.32-rc3 the situation looks
the following:
| git grep _M_SPEC__
|libc/stdio/_vfprintf.c:/* #define __UCLIBC_HAS_PRINTF_M_SPEC__ */
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:# ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:# endif /* __UCLIBC_HAS_PRINTF_M_SPEC__ */
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/old_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/perror.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
And other libc user have to bring their own stuff.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Sami Kerola [Sat, 10 Mar 2012 11:29:35 +0000 (12:29 +0100)]
fileutils: differentiate xmkstemp and xfmkstemp
Let developer to choose, case by case, what sort of return value is
best in her code. The xmkstemp() is for users who want file
descriptor as return value of the function, xfmkstemp() will return
FILE pointer.
Proposed-By: Karel Zak <kzak@redhat.com> CC: Davidlohr Bueso <dave@gnu.org>
Reference: http://marc.info/?l=util-linux-ng&m=133129570124003&w=2 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Karel Zak [Mon, 12 Mar 2012 11:32:03 +0000 (12:32 +0100)]
sulogin: check chdir and getcwd return values [-Wunused-result]
sulogin.c: In function ‘sushell’:
sulogin.c:338:7: warning: ignoring return value of ‘chdir’, declared
with attribute warn_unused_result [-Wunused-result]
sulogin.c:359:8: warning: ignoring return value of ‘getcwd’, declared
with attribute warn_unused_result [-Wunused-result]
Dave Reisner [Tue, 28 Feb 2012 16:45:13 +0000 (11:45 -0500)]
sulogin: replace older signal() with sigaction()
This provides a more reliable means of saving and restoring signal
handlers and avoids ugly (invalid) function pointer assignments. This
also removes the #ifdef blocking usage of a GCC attribute, which is
widely used in the rest of the codebase.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
This causes an infinite loop in mnt_table_next_child_fs, and is
evidenced by a crash via infinite recursion in findmnt. Simply catch the
condition where the ID of the parent is the ID of the current fs we're
examining and skip over it to the next mount in the table.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Christian Wiese [Wed, 15 Feb 2012 12:39:22 +0000 (13:39 +0100)]
fdisk: fix to build for IA32
Tested architectures:
- i486 using gcc -march=i486
- i586 using gcc -march=pentium-mmx
- i686 using gcc -march={pentiumpro,pentium2,pentium3,pentium-m,pentium4}
Without this fix building fdisk fails for for all tested arch/cpu types
emiting following error:
------------------------------------------------------------------------------
In file included from fdiskbsdlabel.c:62:0:
fdiskbsdlabel.h:61:2: error: #error unknown architecture
fdiskbsdlabel.c: In function 'bselect':
fdiskbsdlabel.c:180:44: error: 'BSD_LABELSECTOR' undeclared (first use in this function)
fdiskbsdlabel.c:180:44: note: each undeclared identifier is reported only once for each function it appears in
fdiskbsdlabel.c: In function 'xbsd_write_bootstrap':
fdiskbsdlabel.c:539:24: error: 'BSD_LABELSECTOR' undeclared (first use in this function)
fdiskbsdlabel.c: In function 'xbsd_readlabel':
fdiskbsdlabel.c:744:28: error: 'BSD_LABELSECTOR' undeclared (first use in this function)
fdiskbsdlabel.c:744:60: error: 'BSD_LABELOFFSET' undeclared (first use in this function)
fdiskbsdlabel.c: In function 'xbsd_writelabel':
fdiskbsdlabel.c:769:32: error: 'BSD_LABELSECTOR' undeclared (first use in this function)
fdiskbsdlabel.c:780:61: error: 'BSD_LABELOFFSET' undeclared (first use in this function)
make[2]: *** [fdisk-fdiskbsdlabel.o] Error 1
------------------------------------------------------------------------------
This fix was tested with following major toolchain components:
Karel Zak [Fri, 2 Mar 2012 12:33:46 +0000 (13:33 +0100)]
tests: wait a moment between mount and umount
It seems that without sleep between mount and umount are the test
unstable, because kernel is not able to provide updated
/proc/self/mountinfo so quickly (really?).
Dave Reisner [Fri, 2 Mar 2012 03:47:00 +0000 (22:47 -0500)]
libmount: don't treat "none" differently
This causes more problems than it solves. In the latest edition:
# mount -t proc none foo
mount: foo: mount failed: Invalid argument
A check for source and target fails in mnt_context_apply_fstab()
because, even though they were indeed specified on the cmdline,
__mnt_fs_set_source_ptr() altered this and NULL'd out the source.
If you're able to mount this device via other means, other tools start
reporting oddities, such as mount's output:
Karel Zak [Thu, 1 Mar 2012 13:24:04 +0000 (14:24 +0100)]
libblkid: properly reset chain in probe_do_wipe()
The command wipefs is not able to remove all signatures from the
device if the first detected signature is linux raid. The another
superblock signatures are ignored. For example:
Davidlohr Bueso [Mon, 27 Feb 2012 17:26:40 +0000 (18:26 +0100)]
lslocks: new command
The new lslocks(8) program is meant to replace the deprecated lslk(8). It is
designed for simplicity and removes unnecessary Unix legacy outputs and
options:
- Don't output inode number, whence and maj:min device numbers.
- Don't provide nonblocking syscall options stat(2) and readlink(2)
- Remove lslk's alternate default kernel name list file path (-k)
The option to use nonblocking calls was previously intended for NFS partitions;
however this should be transparent to utility programs considering that
timeouts can occur generically (fuse - sshfs, NFS, netdevs, etc).
Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Sami Kerola [Sun, 26 Feb 2012 21:45:40 +0000 (22:45 +0100)]
docs: do not overwrite ddate.1 manual
The following warning meant either english manual page overwrote ru
version, or otherway around. Neither way that not intented. This
patch will change ru version of the manual page to be installed to
<prefix><mandir>/ru/man1 directory.
man/ru/Makefile.am:4: warning: mandir was already defined in condition TRUE, which includes condition BUILD_DDATE ...
configure.ac:1: ... `mandir' previously defined here
mount: (new) add 'internal-only(i)' to non-root allowed options
Commit ce433404 introduced the change, which causes something like mount -i
<user-mount-path> to break which worked well before util-linux-2.21, now it
gives message 'mount: only root can use "--internal-only" option' when that
shouldn't be the case when it is already in fstab.
Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net>