Petr Uzel [Wed, 26 Jan 2011 11:17:00 +0000 (12:17 +0100)]
mount: fix parsing offset= followed by more options
mount does not parse parse offset= option if it is followed by other
options. In umount, the parsing is done with the get_value() function.
This patch moves get_value to fstab.c (with new name get_option_value())
and fixes mount to use the function.
[kzak@redhat.com: - rename to get_option_value()
- use fstab.c rather than sundries.c]
Novell bugzilla: #666150
Reported-by: Ludwig Nussel <ludwig.nussel@suse.de> Signed-off-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
Fabian Groffen [Tue, 25 Jan 2011 20:40:46 +0000 (21:40 +0100)]
provide a workaround if program_invocation_short_name is missing
Try some replacements, such as getexecname() on Solaris and __progname
on BSDs and Darwin. When not found, base program_invocation_short_name
on the source filename it is used in, as not to require argv[0] to be
passed along. This latter approach is not dynamic, but doesn't require
code changes for all places where program_invocation_short_name is used
now.
Signed-off-by: Fabian Groffen <grobian@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Sami Kerola [Sun, 23 Jan 2011 14:40:18 +0000 (15:40 +0100)]
cfdisk: data type mismatch, and other, compiler warning fixes
Following warnings will longer appear when one will compile with
gcc flags -Wall -Wextra -pedantic
cfdisk.c:475:3: warning: comparison of unsigned expression < 0 is always false
cfdisk.c:487:16: warning: comparison between signed and unsigned integer expressions
cfdisk.c:492:14: warning: comparison between signed and unsigned integer expressions
cfdisk.c:565:19: warning: comparison between signed and unsigned integer expressions
cfdisk.c:569:19: warning: comparison between signed and unsigned integer expressions
cfdisk.c:1070:14: warning: comparison between signed and unsigned integer expressions
cfdisk.c:1568:5: warning: missing initializer
cfdisk.c:1568:5: warning: (near initialization for 'tmp_ext.volume_label')
mbsalign.c:131:2: warning: comparison of unsigned expression >= 0 is always true
Karel Zak [Sun, 23 Jan 2011 21:37:22 +0000 (22:37 +0100)]
libmount: _SC_GETPW_R_SIZE_MAX portability issue
Addresses: https://bugs.gentoo.org/show_bug.cgi?id=350340 Reported-by: Alan Hourihane <alanh@fairlite.co.uk> Signed-off-by: Karel Zak <kzak@redhat.com>
Fabian Groffen [Fri, 21 Jan 2011 16:48:14 +0000 (17:48 +0100)]
include: emulate dirfd when necessary
dirfd is not available on Solaris 10, it is available on latest
OpenSolaris releases though. Do some autoconf trickery to determine if
providing an alternative dirfd function is necessary and possible.
shlibs/blkid/src/read.c: Do not define _XOPEN_SOURCE to 600, or DIR will
lose it's dd_fd member again. Rearrange defines and includes to make
sense per comments, and not conflict on Solaris.
Karel Zak [Fri, 21 Jan 2011 23:09:34 +0000 (00:09 +0100)]
libmount: cleanup API, remove typedef
- replace mnt_ with libmnt_ prefix for types (the old prefix was too generic)
- remove typedef, use struct everywhere
- use shorter functions names (s/userspace/user/; s/mountflags/mflags/)
Fabian Groffen [Mon, 17 Jan 2011 21:00:35 +0000 (22:00 +0100)]
make _IO macros available on Solaris
The _IO macro is defined in sys/ioccom.h on various platforms. However,
on Solaris it isn't included by ioctl.h, so include it explicitly if
available.
Sami Kerola [Mon, 3 Jan 2011 20:42:03 +0000 (21:42 +0100)]
mkfs.cramfs: use symbolic exit codes
For some reason original author had defined symbolic exit codes,
but had not use them. One could argue the symbolic exit codes for
mkfs should go to local exit header which would be included to
all commands that exit with non zero or one return code.
Fabian Groffen [Wed, 12 Jan 2011 20:01:07 +0000 (21:01 +0100)]
build-sys: improve check for crypt
Check for crypt.h existence, and use it if available over using unistd.h
for which a certain feature level has to be set to export a definition
for crypt. On Solaris this set causes a standards conflict in the
headers, because at the time of this check C99 mode is already enabled,
which implies certain standards non-compatible with _XOPEN_SOURCE.
92 #define _XOPEN_SOURCE
93 #include <unistd.h>
configure:16259: gcc -std=gnu99 -c -g -O2 conftest.c >&5
In file included from /usr/include/unistd.h:18,
from conftest.c:93:
/prefix/gentoo/usr/lib/gcc/i386-pc-solaris2.10/4.4.5/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"
configure.ac: improve crypt check
login-utils/my_crypt.h: replace old GNU_LIBRARY check with autoconf
define for crypt.h
[kzak@redhat.com: - remove my_crypt.h]
Signed-off-by: Fabian Groffen <grobian@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Fabian Groffen [Sat, 8 Jan 2011 18:49:38 +0000 (19:49 +0100)]
build-sys: use WORDS_BIGENDIAN to determine platform byte-order
Autoconf contains the right magic to determine the endianness on many
platforms next to Linux. This reverses previous commits to move away
from WORDS_BIGENDIAN:
"use __BYTE_ORDER rather than AC specific WORDS_BIGENDIAN"
This is necessary to compile on non Linux platforms like Darwin and
Solaris.
Karel Zak [Mon, 10 Jan 2011 13:31:23 +0000 (14:31 +0100)]
libmount: add mount(8) sample
This code is going to be used as mount(8) replacement in the next
major release (2.20). For now this mount(8) implementation does not
support loopdevs initialization.
Karel Zak [Wed, 5 Jan 2011 15:50:47 +0000 (16:50 +0100)]
fdisk: re-print prompt after maybe_exit()
after
Do you really want to quit? n
the read_chars() has to re-print the original prompt and ask again
for new input. For example:
Partition number (1-4, default 3): <-- CTRL-D
Do you really want to quit? n
Partition number (1-4, default 3): 3 <-- ask again
First sector (411648-1023999, default 411648):
Karel Zak [Wed, 5 Jan 2011 12:17:12 +0000 (13:17 +0100)]
build-sys: use generated libtool-2 stuff
The commit 60a4edd66200be829560dce0d41a02fc70cef4f5 temporary disabled
libtool-2 in autogen.sh. It seems that libtool-2 in available in
many distributions now, so we don't have to manage the generated .m4
libtool files in git anymore.