~ubuntu-branches/ubuntu/intrepid/partman-base/intrepid

« back to all changes in this revision

Viewing changes to partmap.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2007-10-23 15:38:01 UTC
  • Revision ID: james.westby@ubuntu.com-20071023153801-56gnrn5z5nerik2y
Tags: 110ubuntu1
* Resynchronise with Debian. Remaining changes:
  - Ubiquity integration: If PARTMAN_NO_COMMIT is set, then exit rather
    than running commit.d and finish.d scripts; add a partman-commit
    script; dump extra information to /var/lib/partman/snoop if
    PARTMAN_SNOOP is set.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *      libparted-based partition map identifier
 
3
 *      Copyright (C) 2007      Robert Millan <rmh@aybabtu.com>
 
4
 *
 
5
 *      This program is free software; you can redistribute it and/or modify
 
6
 *      it under the terms of the GNU General Public License as published by
 
7
 *      the Free Software Foundation; either version 2 of the License, or
 
8
 *      (at your option) any later version.
 
9
 *
 
10
 *      This program is distributed in the hope that it will be useful,
 
11
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.    See the
 
13
 *      GNU General Public License for more details.
 
14
 *
 
15
 *      You should have received a copy of the GNU General Public License along
 
16
 *      with this program; if not, write to the Free Software Foundation, Inc.,
 
17
 *      51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
18
 */
 
19
 
 
20
#include <parted/parted.h>
 
21
#include <stdio.h>
 
22
 
 
23
int
 
24
main (int argc, char **argv)
 
25
{
 
26
        PedDevice *device;
 
27
        PedDisk *disk;
 
28
 
 
29
        if (argc != 2) {
 
30
                fprintf (stderr, "Usage: %s DEVICE\n", argv[0]);
 
31
                exit (1);
 
32
        }
 
33
 
 
34
        device = ped_device_get (argv[1]);
 
35
        if (!device)
 
36
                exit (1);
 
37
 
 
38
        disk = ped_disk_new (device);
 
39
        if (!disk)
 
40
                exit (1);
 
41
 
 
42
        printf ("%s\n", disk->type->name);
 
43
 
 
44
        return 0;
 
45
}