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

« back to all changes in this revision

Viewing changes to 1.0.0.rc15/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
 
18
main(int argc, char **argv)
 
19
{
 
20
        int ret = 0;
 
21
        struct lib_context *lc;
 
22
 
 
23
        /* Initialize library (creates a context to use it). */
 
24
        if ((lc = libdmraid_init(argc, argv))) {
 
25
                /*
 
26
                 * Parse command line arguments and run 'early'
 
27
                 * functions for options which set library context
 
28
                 * variables (eg, --debug).
 
29
                 *
 
30
                 * Initialize locking afterwards, so that the
 
31
                 * '--ignorelocking' option can be recognized.
 
32
                 *
 
33
                 * If both are ok -> perform the required action.
 
34
                 */
 
35
                ret = handle_args(lc, argc, &argv) &&
 
36
                        init_locking(lc) && 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
}