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

« back to all changes in this revision

Viewing changes to tools/hal-storage-eject.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:
35
35
 
36
36
#include <libhal.h>
37
37
#include <libhal-storage.h>
38
 
#ifdef HAVE_POLKIT
39
 
#include <libpolkit.h>
40
 
#endif
41
38
 
42
39
#include "hal-storage-shared.h"
43
40
 
82
79
        DBusError error;
83
80
        LibHalContext *hal_ctx = NULL;
84
81
        DBusConnection *system_bus = NULL;
85
 
#ifdef HAVE_POLKIT
86
 
        LibPolKitContext *pol_ctx = NULL;
87
 
#endif
88
82
        char *invoked_by_uid;
89
83
        char *invoked_by_syscon_name;
90
84
        char **volume_udis;
124
118
                }
125
119
                usage ();
126
120
        }
127
 
#ifdef HAVE_POLKIT
128
 
        pol_ctx = libpolkit_new_context (system_bus);
129
 
        if (pol_ctx == NULL) {
130
 
                printf ("Cannot get libpolkit context\n");
131
 
                unknown_eject_error ("Cannot get libpolkit context");
132
 
        }
133
 
#endif
134
121
 
135
122
        /* read from stdin */
136
123
        if (strlen (fgets (eject_options, sizeof (eject_options), stdin)) > 0)
203
190
                                unknown_eject_error ("Cannot obtain lock on /media/.hal-mtab");
204
191
                        }
205
192
                        handle_unmount (hal_ctx, 
206
 
#ifdef HAVE_POLKIT
207
 
                                        pol_ctx, 
208
 
#endif
209
193
                                        udi, volume_to_unmount, drive, 
210
194
                                        libhal_volume_get_device_file (volume_to_unmount), 
211
195
                                        invoked_by_uid, invoked_by_syscon_name,
224
208
 
225
209
        /* now attempt the eject */
226
210
        handle_eject (hal_ctx, 
227
 
#ifdef HAVE_POLKIT
228
 
                      pol_ctx, 
229
 
#endif
230
211
                      libhal_drive_get_udi (drive),
231
212
                      drive,
232
213
                      libhal_drive_get_device_file (drive),