|
Lines 97-103
int Is_Device_Mounted(char *Device_Name)
Link Here
|
| 97 |
FILE *Mount_Records; /* Pointer for system's mount records */ |
97 |
FILE *Mount_Records; /* Pointer for system's mount records */ |
| 98 |
struct mntent *Mount_Data; /* Holds data for entry in mount list */ |
98 |
struct mntent *Mount_Data; /* Holds data for entry in mount list */ |
| 99 |
int Mounted_RC = 0; /* Holds return code. */ |
99 |
int Mounted_RC = 0; /* Holds return code. */ |
| 100 |
char Root_FS_Type[] = "0000000"; |
100 |
int root_not_jfs = 0; |
| 101 |
|
101 |
|
| 102 |
#define ROOT_DIR "/" |
102 |
#define ROOT_DIR "/" |
| 103 |
|
103 |
|
|
Lines 113-121
int Is_Device_Mounted(char *Device_Name)
Link Here
|
| 113 |
|
113 |
|
| 114 |
/* Attempt to find specified device name in mount records */ |
114 |
/* Attempt to find specified device name in mount records */ |
| 115 |
while ((Mount_Data = getmntent(Mount_Records)) != NULL) { |
115 |
while ((Mount_Data = getmntent(Mount_Records)) != NULL) { |
| 116 |
/* save root file system type for later, if needed */ |
116 |
/* |
| 117 |
if (strcmp(ROOT_DIR, Mount_Data->mnt_dir) == 0) |
117 |
* There may be more than one entry for /. Trust the |
| 118 |
strcpy(Root_FS_Type, Mount_Data->mnt_type); |
118 |
* latest one |
|
|
119 |
*/ |
| 120 |
if (strcmp(ROOT_DIR, Mount_Data->mnt_dir) == 0) { |
| 121 |
if (strcmp("jfs", Mount_Data->mnt_type) == 0) |
| 122 |
root_not_jfs = 0; |
| 123 |
else |
| 124 |
root_not_jfs = 1; |
| 125 |
} |
| 119 |
if (strcmp(Device_Name, Mount_Data->mnt_fsname) == 0) |
126 |
if (strcmp(Device_Name, Mount_Data->mnt_fsname) == 0) |
| 120 |
break; |
127 |
break; |
| 121 |
} |
128 |
} |
|
Lines 141-148
int Is_Device_Mounted(char *Device_Name)
Link Here
|
| 141 |
* Make a best effort to ensure that |
148 |
* Make a best effort to ensure that |
| 142 |
* the root file system type is jfs |
149 |
* the root file system type is jfs |
| 143 |
*/ |
150 |
*/ |
| 144 |
if ((strcmp(Root_FS_Type, "0000000") != '0') && |
151 |
if (root_not_jfs) |
| 145 |
(strcmp(Root_FS_Type, "jfs") != 0)) |
|
|
| 146 |
/* is mounted, found type, is not type jfs */ |
152 |
/* is mounted, found type, is not type jfs */ |
| 147 |
Mounted_RC = MSG_JFS_NOT_JFS; |
153 |
Mounted_RC = MSG_JFS_NOT_JFS; |
| 148 |
} |
154 |
} |