~psusi/ubuntu/precise/dmraid/fix-gpt

« back to all changes in this revision

Viewing changes to 1.0.0.rc14/tools/dmraid.c

  • Committer: Bazaar Package Importer
  • Author(s): Giuseppe Iuculano, 6af052c
  • Date: 2009-03-25 22:34:59 UTC
  • mfrom: (2.1.9 sid)
  • mto: (2.4.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20090325223459-y54f0rmxem7htn6r
Tags: 1.0.0.rc15-6
[6af052c] Remove 15_isw_incorrect_status_fix.patch, it causes a
segfault. (Closes: #521104)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2004,2005  Heinz Mauelshagen, Red Hat GmbH.
3
 
 *                          All rights reserved.
4
 
 *
5
 
 * See file LICENSE at the top of this source tree for license information.
6
 
 */
7
 
 
8
 
/*
9
 
 * See commands.[ch] for the perform() function call abstraction below.
10
 
 */
11
 
 
12
 
#include <dmraid/dmraid.h>
13
 
#include "commands.h"
14
 
#include "toollib.h"
15
 
#include "version.h"
16
 
 
17
 
int main(int argc, char **argv)
18
 
{
19
 
        int ret = 0;
20
 
        struct lib_context *lc;
21
 
 
22
 
        /* Initialize library (creates a context to use it). */
23
 
        if ((lc = libdmraid_init(argc, argv))) {
24
 
                /*
25
 
                 * Parse command line arguments and run 'early'
26
 
                 * functions for options which set library context
27
 
                 * variables (eg, --debug).
28
 
                 *
29
 
                 * Initialize locking afterwards, so that the
30
 
                 * '--ignorelocking' option can be recognized.
31
 
                 *
32
 
                 * If both are ok -> perform the required action.
33
 
                 */
34
 
                ret = handle_args(lc, argc, &argv) &&
35
 
                      init_locking(lc) &&
36
 
                      perform(lc, argv);
37
 
 
38
 
                /* Cleanup the library context. */
39
 
                libdmraid_exit(lc);
40
 
        }
41
 
 
42
 
        /* Set standard exit code. */
43
 
        exit (ret ? EXIT_SUCCESS : EXIT_FAILURE);
44
 
}