properly implemented fdisk_dev_has_topology() requires optimal
I/O size to detect that the device provides topology.
Unfortunately, currently used cxt->io_size maybe overwritten in
__discover_topology() to min_io_size.
This patch introduces cxt->optimal_io_size and keeps it independent on
cxt->io_size. The cxt->io_size is I/O size used by fdisk for alignment
calculation.
Signed-off-by: Karel Zak <kzak@redhat.com>
This patch adds device topology discovery to the internal API. This
functionality is static only to the API and therefore hidden from general fdisk
code. Functionality itself doesn't really change, min_io_size, io_size, logical
and physical sector sizes and alignment offset are added to the fdisk_context
structure and elements are accessed from there. The logical sector size
(sector_size) is now unsigned long instead of unsigned int, this as no effect
otherwise.
A few things to notice:
- The patch is larger than I wanted but we need to modify function parameters
across fdisk and its labels to use the topology data from cxt-> instances.
Hopefully this will be pretty much it regarding this kind of modifications -
perhaps geometry will need something of the like too.
- The -b option must override internal discovery.
- A new helper function has added to verify if the device provides topology
information, this replaces the 'has_topology' global variable.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
This program heavily uses global variables, which isn't very elegant and can
lead to nasty bugs. Modify functions that use fdisk's context current features
(descriptor and path), to receive the context as a parameter instead of
globally. This includes DOS, SUN, SGI and BSD label code. Another benefit that
comes with this is that as the API grows all the information regarding fdisk
will be accessible from this structure so we can reduce even more global
variables and simply code.
This patch passed:
- building
- regression tests
- local dos/sun/bsd partition changes
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Recently, commit 0a86755fe8 directed the welcome
message output from stderr to stdout breaking regression tests. Correct this
by flushing stdout and stop buffering the output - a trivial function is
created as well.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* '2012wk22' of git://github.com/kerolasa/lelux-utiliteetit:
docs: clean up getopt.1 manual
docs: clean up dmesg.1 manual
docs: clean up chcpu.8 manual
fileutils: xmkstemp() interface change
docs: fix all man page groff warnings
tools: add checkmans.sh
docs: clean up wdctl.8 manual
docs: clean up login.1 manual
login: allow TTYGROUP name begin by number
build-sys: add su executable to .gitignore
logindefs: change getlogindefs_num() to return unsigned long
Conflicts:
login-utils/su.c
sys-utils/dmesg.1
Fixes a bug in option string parsing wherein a line such as:
ro,relatime,,nosuid,nodev
Will be seen as only the tokens "ro" and "relatime" after the parser
encounters a zero length (and erroneously declared NULL) option.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Some libc do not expose program_invocation_short_name. Therefore util-linux
comes with helpers in 'c.h'. Use the 'c.h' in hexsyntax.c where it was missed.
This patch fixes following error for me:
---8<---
hexsyntax.c: In function 'newsyntax':
hexsyntax.c:115: error: 'program_invocation_short_name' undeclared (first use in this function)
hexsyntax.c:115: error: (Each undeclared identifier is reported only once
hexsyntax.c:115: error: for each function it appears in.)
--->8---
Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
regexec only returns 0 or REG_NOMATCH so remove a meaningless test
Signed-off-by: Jeremy Huntwork <jhuntwork@lightcubesolutions.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
* Add lightness to synopsis.
* Add spaces after dots (English spacing).
* Replace backticks by ticks.
* Reformat text to be 70 characters wide.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Add lightness to synopsis.
* Add few missing italic highlights to text segments which refer
command line argument(s).
* Turn off bold where ever possible (makes text unnecessarily heavy).
* Add spaces after dots (English spacing).
* Use URL and email macros where appropriate.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Add lightness to synopsis.
* Use argument and parameter highlights consistently.
* Indent dispatch modes.
* Add spaces after dots (English spacing).
* Add line break macros.
* Use URL and email macros where appropriate.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
We can not let the user control where TMPDIR is for this tempfile.
This will be where we write the updated passwd file, and must be
capable of being moved atomically with rename(2). Therefore, it
cannot be on a different device, or setpwnam() and vipw/vigr programs
will invariably fail with EXDEV.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
PATH contents for users & root in DESCRIPTION section where wrong,
and couple default values where missing. Rest of the change is about
making the groff, and the output, to look good.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Assuming someone is using a TTYGROUP name beginnign by a digit the
login was misbehaving with 'contains invalid numerical value: %s'
message(s) in syslog. Please notice that group names that consist
only digits as characters are valid (but likely to cause confusion,
and chaos).
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Where ever getlogindefs_num() is called return value is always
expected to be unsigned, such as sleep() input, gid_t or mode_t.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>