rmm_common.c revision 0ebe310024a809595007753781dc9969750affbc
1N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1N/A#include <libhal-storage.h>
1N/A#include "rmm_common.h"
1N/Astatic const char *action_strings[] = {
char **devices;
int nr;
return (NULL);
return (NULL);
return (NULL);
return (NULL);
return (NULL);
return (ctx);
char lastc;
lastc = *p;
p = NULL;
goto out;
goto out;
goto out;
out:
if (p != NULL) {
*p = lastc;
return (drive);
return (drive);
char **udis;
int num_udis;
return (NULL);
for (i = 0; i < num_udis; i++) {
&error)) {
if (v != NULL) {
return (drive);
drive_nicknames[i]);
if ((v != NULL) &&
if ((v != NULL) &&
int print_mask)
char **udis;
int num_udis;
LibHalVolume *v;
const char *device;
char **nicknames;
GSList *j;
int nprinted;
for (i = 0; i < num_udis; i++) {
nprinted = 0;
NULL) {
(libhal_volume_get_fsusage(v) !=
nprinted++;
if ((nprinted == 0) &&
char **udis;
int num_udis;
char **nicknames;
return (NULL);
return (drive);
GSList *i;
char *fstype;
return (B_FALSE);
return (B_FALSE);
return (B_FALSE);
return (B_TRUE);
return (B_FALSE);
return (B_FALSE);
return (B_FALSE);
return (B_TRUE);
return (B_FALSE);
return (B_FALSE);
return (B_FALSE);
return (B_TRUE);
udi);
return (B_FALSE);
udi);
return (B_FALSE);
return (B_FALSE);
return (B_TRUE);
udi);
return (B_FALSE);
return (B_FALSE);
return (B_TRUE);
return (B_FALSE);
return (B_FALSE);
return (B_FALSE);
return (B_TRUE);
return (B_FALSE);
return (B_FALSE);
return (B_FALSE);
return (B_TRUE);
static boolean_t
char *mountp;
switch (action) {
case EJECT:
case INSERT:
case REMOUNT:
if (libhal_volume_is_mounted(v)) {
goto done;
case UNMOUNT:
if (!libhal_volume_is_mounted(v)) {
goto done;
case CLOSETRAY:
if (!ret) {
goto done;
switch (action) {
case EJECT:
case INSERT:
case REMOUNT:
case UNMOUNT:
case CLOSETRAY:
done:
return (ret);
LibHalDrive *d;
LibHalVolume *v;
if (d == NULL) {
return (B_FALSE);
goto out;
goto out;
udi);
if (ret) {
out:
return (ret);
const char *drive_udi;
char **udis;
int num_udis;
char *nickname;
return (B_FALSE);
return (B_TRUE);
for (i = 0; i < num_udis; i++) {
if (query) {
if (ret) {
if (do_free_udis) {
return (ret);
const char *drive_udi;
char *volume_label;
char *mountpoint;
int len;
return (B_FALSE);
goto out;
goto out;
goto out;
goto out;
goto out;
goto out;
goto out;
goto out;
goto out;
goto out;
goto out;
out:
if (!ret) {
return (ret);
FILE *f;
fclose(f);
return (mount_point);
const char *str;
switch (rmm_error) {
case RMM_EOK:
case RMM_EDBUS_CONNECT:
case RMM_EHAL_CONNECT:
return (str);
rmm_vold_isbadchar(int c)
int ret_val = 0;
return (ret_val);
char *s = buf;
for (i = 0; i < len; i++) {
*s++ = name[i];
* swiped from mkdir.c
int err;
char *slash;
return (err);
if (rmm_debug == 0) {
p = fmt;