Lines 236-242
Link Here
|
236 |
|
236 |
|
237 |
hfp_cdrom_free(cdrom); |
237 |
hfp_cdrom_free(cdrom); |
238 |
} |
238 |
} |
239 |
else if (! has_children) /* by definition, if it has children it has no fs */ |
239 |
else |
|
|
240 |
{ |
241 |
int fd; |
242 |
off_t size; |
243 |
|
244 |
fd = open(device_file, O_RDONLY | O_NONBLOCK); |
245 |
if (fd > -1) |
246 |
{ |
247 |
libhal_device_set_property_bool(hfp_ctx, hfp_udi, "storage.removable.media_available", TRUE, &hfp_error); |
248 |
if (ioctl (fd, DIOCGMEDIASIZE, &size) == 0) |
249 |
{ |
250 |
libhal_device_set_property_uint64(hfp_ctx, hfp_udi, "storage.removable.media_size", size, &hfp_error); |
251 |
} |
252 |
close(fd); |
253 |
} |
254 |
else |
255 |
{ |
256 |
libhal_device_set_property_bool(hfp_ctx, hfp_udi, "storage.removable.media_available", FALSE, &hfp_error); |
257 |
} |
258 |
|
259 |
if (! has_children) /* by definition, if it has children it has no fs */ |
240 |
{ |
260 |
{ |
241 |
struct volume_id *vid; |
261 |
struct volume_id *vid; |
242 |
|
262 |
|
Lines 249-254
Link Here
|
249 |
|
269 |
|
250 |
volume_id_close(vid); |
270 |
volume_id_close(vid); |
251 |
} |
271 |
} |
|
|
272 |
} |
252 |
|
273 |
|
253 |
end: |
274 |
end: |
254 |
return ret; |
275 |
return ret; |