~ubuntu-branches/debian/sid/hal/sid

« back to all changes in this revision

Viewing changes to tools/hal-storage-unmount.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2007-10-23 12:33:58 UTC
  • Revision ID: james.westby@ubuntu.com-20071023123358-xaf8mjc5n84d5gtz
Tags: upstream-0.5.10
ImportĀ upstreamĀ versionĀ 0.5.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
#include <libhal.h>
52
52
#include <libhal-storage.h>
53
 
#ifdef HAVE_POLKIT
54
 
#include <libpolkit.h>
55
 
#endif
56
53
 
57
54
#include "hal-storage-shared.h"
58
55
 
81
78
        DBusError error;
82
79
        LibHalContext *hal_ctx = NULL;
83
80
        DBusConnection *system_bus = NULL;
84
 
#ifdef HAVE_POLKIT
85
 
        LibPolKitContext *pol_ctx = NULL;
86
 
#endif
87
81
        char *invoked_by_uid;
88
82
        char *invoked_by_syscon_name;
89
83
        int i;
127
121
                }
128
122
                usage ();
129
123
        }
130
 
#ifdef HAVE_POLKIT
131
 
        pol_ctx = libpolkit_new_context (system_bus);
132
 
        if (pol_ctx == NULL) {
133
 
                printf ("Cannot get libpolkit context\n");
134
 
                unknown_error ("Cannot get libpolkit context");
135
 
        }
136
 
#endif
137
124
 
138
125
        /* read from stdin */
139
126
        if (strlen (fgets (unmount_options, sizeof (unmount_options), stdin)) > 0)
180
167
                        usage ();
181
168
                } else {
182
169
                        handle_unmount (hal_ctx, 
183
 
#ifdef HAVE_POLKIT
184
 
                                        pol_ctx, 
185
 
#endif
186
170
                                        udi, NULL, drive, device, invoked_by_uid, 
187
171
                                        invoked_by_syscon_name, use_lazy, use_force);
188
172
                }
200
184
                        unknown_error ("Cannot get drive from hal");
201
185
 
202
186
                handle_unmount (hal_ctx, 
203
 
#ifdef HAVE_POLKIT
204
 
                                pol_ctx, 
205
 
#endif
206
187
                                udi, volume, drive, device, invoked_by_uid, 
207
188
                                invoked_by_syscon_name, use_lazy, use_force);
208
189