summaryrefslogtreecommitdiff
path: root/fdisk/delpart.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2006-12-07 00:25:43 +0100
committerKarel Zak <kzak@redhat.com>2006-12-07 00:25:43 +0100
commit22853e4a82c6ef7b336527529acb94b14a0b0fd8 (patch)
treeee28e4598c8c449d7e811711d8ce8eb17caecfb6 /fdisk/delpart.c
parenteb63b9b8f4cecb34c2478282567862bc48ef256d (diff)
downloadutil-linux-22853e4a82c6ef7b336527529acb94b14a0b0fd8.tar.gz
Imported from util-linux-2.10m tarball.
Diffstat (limited to 'fdisk/delpart.c')
-rw-r--r--fdisk/delpart.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/fdisk/delpart.c b/fdisk/delpart.c
deleted file mode 100644
index 8504c022..00000000
--- a/fdisk/delpart.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* very primitive wrapper around the `delete partition' ioctl */
-#include <stdio.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <linux/blkpg.h>
-
-int
-main(int argc, char **argv){
- int fd;
- struct blkpg_ioctl_arg a;
- struct blkpg_partition p;
-
- if (argc != 3) {
- fprintf(stderr,
- "usage: %s diskdevice partitionnr\n",
- argv[0]);
- exit(1);
- }
- if ((fd = open(argv[1], O_RDONLY)) < 0) {
- perror(argv[1]);
- exit(1);
- }
- p.pno = atoi(argv[2]);
- p.start = 0;
- p.length = 0;
- p.devname[0] = 0;
- p.volname[0] = 0;
- a.op = BLKPG_DEL_PARTITION;
- a.flags = 0;
- a.datalen = sizeof(p);
- a.data = &p;
-
- if (ioctl(fd, BLKPG, &a) == -1) {
- perror("BLKPG");
- exit(1);
- }
-
- return 0;
-}