Commit Graph

34 Commits

Author SHA1 Message Date
Karel Zak 1aff9b620e partx: use c.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-16 01:35:55 +02:00
Karel Zak fa2b1cb32e partx: work properly with 512 sectors (dos PT)
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-09-07 12:07:07 +02:00
Peter Breitenlohner 5b620ebd4f partx.8: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:11 +02:00
Peter Breitenlohner 06191c0fce delpart.8: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:11 +02:00
Peter Breitenlohner 50a468cf6a addpart.8: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:11 +02:00
Daniel Mierswa c0f19ccff7 replace bcopy,bzero,index and rindex
Those 4 functions are marked as LEGACY in POSIX.1-2001 and removed in
POSIX.1-2008.

Replaced with memmove,memset,strchr and strrchr.

Signed-off-by: Daniel Mierswa <impulze@impulze.org>
2009-08-17 11:15:59 +02:00
Karel Zak 30688dde55 build-sys: rename to _execdir
The variable name "usrlibexecdir" is very confusing (because we have
/usr/libexec). The "exec" prefix is required for user-defined
directories, see

   http://www.gnu.org/software/hello/manual/automake/The-Two-Parts-of-Install.html#The-Two-Parts-of-Install

This patch renames all usr*execdir variables to usr*_execdir.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-07-04 01:23:41 +02:00
Karel Zak c59599d1e8 partx: use ioctls from lib/blkdev.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-26 23:19:19 +01:00
Karel Zak f314a6becc fdisk: (and partx) remove BLKGETLASTSECT
This odd ioctl is unsupported in the current 2.4 and 2.6 mainline.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-26 23:03:46 +01:00
Karel Zak 0d518f3420 partx: don't duplicate lib/blkdev.c code
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-26 15:58:28 +01:00
Karel Zak 176303e08d partx: convert hard sector size to 512-byte sectors
The msdos PT depends on a sector size (BLKSSZGET), but partx(8) counts
internally with 512-byte sectors only. The dos.c has to convert start
and size to 512-byte sectors.

sysfs (kernel uses 512-byte sectors only):

  # cat /sys/block/sdb/sdb1/{start,size}
  256
  16128

(note that 16128 * 512 = 8257536; 8Mb)

old version:

  # partx /dev/sdb
  1:        32-     2047 (     2016 sectors,      1 MB)
                                                  ^^^^
start, end and sectors are correct, but in 4KiB sectors
The size in MB is completely wrong.

new version:

  # partx -l /dev/sdb
  1:       256-    16383 (    16128 sectors,      8 MB)

start, end and sectors are converted to 512-byte sectors. The size in
MB is correct now.

Note that this change is important, because "partx -a" counts the size
of a new partition in 512-byte sectors for all PT formats (sun, gpt, ...).

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-26 15:58:28 +01:00
Karel Zak fa39bf0f12 addpart: 512-byte sectors in code, bytes in man-page
The addpart.c code uses 512-byte sectors for partition start and
length, but in the addpart.8 man page is "in bytes". The code (and
this code is pretty old) is always right... the man page has to be
fixed.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-26 15:58:28 +01:00
maximilian attems 3342f88dec partx: don't redeclare daddr_t
klibc porting fix, use proper include, nuke redefinition.
solaris.c:8: error: redefinition of typedef ‘daddr_t’
/usr/lib/klibc/include/sys/types.h:29: error: previous declaration of ‘daddr_t’ was here

Signed-off-by: maximilian attems <max@stro.at>
2008-09-16 11:29:42 +02:00
Karel Zak 00077d4d53 build-sys: update .gitignore files
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14 14:24:03 +02:00
Karel Zak 97a88ccb35 partx: fix compiler warnings
dos.c:44: warning: pointer targets in assignment differ in signedness
dos.c:93: warning: pointer targets in assignment differ in signedness

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-03-20 15:23:16 +01:00
Jim Meyering 71c445db69 remove useless if-before-free tests.
E.g., in this example, the "if (p)" test is useless.

  if (p)
    free (p);

I've been removing such tests systematically.
Here's where I proposed it to the git folks, along with justification
for why it's ok to perform this transformation, these days (no one
uses SunOS4 anymore):

    http://thread.gmane.org/gmane.comp.version-control.git/74187

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-12 12:00:39 +01:00
Karel Zak d01ee8e666 partx: use swab macros from bitops.h
Clean up GPT code:
	- remove C++ comments
	- tailing white-spaces
	- use cpu_to_  swab macros from bitops.h

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-12-17 13:57:28 +01:00
Stepan Kasal a3ca3a44c5 build-sys: use dist_man_MANS instead of man_MANS
Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-12-17 10:08:49 +01:00
Karel Zak 86d62711a9 man pages: add "AVAILABILITY" section
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-03 01:17:04 +02:00
Karel Zak 2f2d6528e3 partx: add man pages for addpart, delpart and partx
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-02-09 19:15:23 +01:00
Karel Zak 562218e6ea build-sys: add missing files
This patch add all missing headers, man pages and README files to automake
stuff and "make dist-gzip" produces useful tarball now.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-04 11:57:07 +01:00
Karel Zak 8eeb575c0d build-sys: remove generated autotools stuff from git
The generated autotools stuff shouldn't be maintained by SCM. After check out
from git use ./autogen.sh. For more details see README.devel.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-03 22:20:44 +01:00
Karel Zak cf6d7faebb Imported from util-linux-2.13-pre6 tarball. 2006-12-07 00:27:13 +01:00
Karel Zak ca3ea756e7 Imported from util-linux-2.13-pre4 tarball. 2006-12-07 00:27:06 +01:00
Karel Zak 9cb689775c Imported from util-linux-2.13-pre3 tarball. 2006-12-07 00:27:03 +01:00
Karel Zak baf39af15b Imported from util-linux-2.13-pre2 tarball. 2006-12-07 00:26:58 +01:00
Karel Zak 48d7b13a1e Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00
Karel Zak c129767e06 Imported from util-linux-2.12b tarball. 2006-12-07 00:26:16 +01:00
Karel Zak d03dd60840 Imported from util-linux-2.12a tarball. 2006-12-07 00:26:14 +01:00
Karel Zak 95f1bdeee4 Imported from util-linux-2.11x tarball. 2006-12-07 00:26:05 +01:00
Karel Zak f0c8eda12c Imported from util-linux-2.11u tarball. 2006-12-07 00:26:00 +01:00
Karel Zak 63cccae468 Imported from util-linux-2.11t tarball. 2006-12-07 00:25:58 +01:00
Karel Zak 1d4ad1decc Imported from util-linux-2.11q tarball. 2006-12-07 00:25:54 +01:00
Karel Zak 22853e4a82 Imported from util-linux-2.10m tarball. 2006-12-07 00:25:43 +01:00