History log of /openbsd-current/sbin/pdisk/io.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.31 01-Feb-2016 krw

Use printf("%s",prompt) rather than printf(prompt) just for paranoia's
sake.


# 1.30 30-Jan-2016 krw

Move last three lines (#define's) from dpme.h to partition_map.h and
tweak #include's as necessary.


# 1.29 29-Jan-2016 krw

Base 10 should be enough for anybody! Allowing hex and octal number
input for partition id's, partition starting points and partition
sizes is silly, especially since we never display anything but base
10 numbers.

Also ensure that numbers end with a space, tab or newline.


# 1.28 28-Jan-2016 krw

Use consistent 'return' idiom -- no parenthesis since that was the style
of the existing code.


# 1.27 27-Jan-2016 krw

On-disk partition name/types/processorid may or may not be NUL
terminated after all. So add an extra byte for a NUL in the in-memory
struct's.


# 1.26 27-Jan-2016 krw

Nope. Missed a couple of '{}' that could go.


# 1.25 27-Jan-2016 krw

Nuke another (and I hope final) batch of superfluous '{}' around single
statements.


# 1.24 26-Jan-2016 krw

Rework and simplify string argument parsing. All string arguments are at
most DPISTRLEN (32) characters so there is no need for fancy dynamic
growing strings. Use a DPISTRLEN long buffer and bail if it fills up.

Rename get_string() to get_dpistr() and get_string_argument() to
get_dpstr_argument() to emphasize they will return strings that fit
in DPISTRLEN.

Rework & simplify a pair of their consumers - do_rename_partition() and
do_change_type() - to be more obviously identitical to each other bar
the displayed verbiage.


# 1.23 26-Jan-2016 krw

Whitespace, line wrapping fixes. Nuke many superfluous '{}' around single
statements. 0 -> NULL for pointer checks.


# 1.22 24-Jan-2016 krw

Whitespace fixes.


# 1.21 23-Jan-2016 krw

No need for 'default_value' parameter for get_number_argument() since we
always pass kDefault. a.k.a. -1. Nuke kDefault since it is now unused.

Nuke unused #define MAXIOSIZE in passing.


# 1.20 23-Jan-2016 krw

No need for get_string_argument() parameter 'reprompt' since we
always pass it '1'.


# 1.19 21-Jan-2016 krw

Hoist all file opening and ioctl calls into main(), passing a pointer to
a valid map to edit(). Should enable pledging a la fdisk at some point.

Since edit() always gets a valid map (and maintains its validity even when
'I'nitializing a new one) many checks for (map == NULL) are junked.

Remove some dances around block sizes by using DEV_BSIZE everywhere
since we don't support non-DEV_BSIZE (a.k.a. 512-byte) sectors.

Remove many superfluous #include statements.


# 1.18 19-Jan-2016 krw

Remove unused global 'io_buffer'.


# 1.17 18-Jan-2016 krw

Run indent(1) over it and tweak the results a bit manually to look more
KNF'ish.


# 1.16 17-Jan-2016 krw

Change "//" comments to "/**/". Nuke really stupid ones.


# 1.15 17-Jan-2016 krw

Reduce namespace pollution by eliminating parameter names from forward
declarations.


# 1.14 17-Jan-2016 krw

Kill leading, imbedded, trailing whitespace.


# 1.13 17-Jan-2016 krw

Remove a bunch of ridiculous and uninformative comments like "// Defines".


# 1.12 12-Jan-2016 krw

#define LOFF_T off_t
#define llseek lseek
#define LOFF_T_MAX LLONG_MAX

I mean, really? Nuke'em and use off_t, lseek and LLONG_MAX.

Also make a couple of checks for overflow of off_t value more likely
to work.

ok millert@


# 1.11 12-Jan-2016 krw

Use normal err/errx/warn/warnx rather than handrolling new ones. Move
usage() to pdisk.c and nuke do_help() and '-h'.

ok jasper@ deraadt@


# 1.10 11-Jan-2016 jasper

trailing whitespace


# 1.9 11-Jan-2016 jasper

add rcs ids


# 1.8 20-Aug-2015 deraadt

<stdlib.h> is included, so do not need to cast result from
malloc, calloc, realloc*
ok krw millert


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.7 11-May-2006 martin

remove a bunch of linux and NeXT defines and, in turn, -D__unix__


# 1.6 29-Apr-2006 martin

With last pdisk and full functionality for mac68k now in place, start
cleaning the maze of ifdef's not relevant for us.

This round wipes most linux and/or MacOS-only bits, more to come.


# 1.5 27-Apr-2006 martin

update for pdisk 0.8a2, from NetBSD, retaining our local changes;
summing it up:

- Clean up sources - fix naming, delete old email addresses
- Added support for display of Mac volume names
- Fix block 0 display to show logical offset of drivers
- Require confirmation of quit without write
- Fix iteration to not complain about missing devices
- Warn when creating/writing a map with more than 15 entries

and, most important, add do_update_dpme() which allows us to partition
OpenBSD slices without previous MacOS setup.

Tested with shared MacOS install on macppc, procedure there remains the
same.

grammer and spelling help and ok jmc@

ok miod@


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.4 09-Jun-2002 todd

rm trailing whitespace


Revision tags: OPENBSD_3_1_BASE
# 1.3 05-Nov-2001 mpech

kill more registers;

millert@ ok


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.2 24-Mar-2001 drahn

Make the apple code compile for OpenBSD. These changes are mostly from maja.


# 1.1 24-Mar-2001 drahn

branches: 1.1.1;
Initial revision