View | Details | Raw Unified | Return to bug 116950
Collapse All | Expand All

(-)libfs/fssubs.c.orig (-4 / +5 lines)
Lines 97-106 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
	char Root_FS_Type[128];
101
101
102
#define ROOT_DIR "/"
102
#define ROOT_DIR "/"
103
103
104
	memset(Root_FS_Type, 0, sizeof(Root_FS_Type));
105
104
	/* Attempt to open /proc/mounts for access. */
106
	/* Attempt to open /proc/mounts for access. */
105
	if ((Mount_Records = setmntent("/proc/mounts", "r")) == NULL) {
107
	if ((Mount_Records = setmntent("/proc/mounts", "r")) == NULL) {
106
		/* Unable to access list of mounted devices in /proc/mounts! */
108
		/* Unable to access list of mounted devices in /proc/mounts! */
Lines 115-121 Link Here
115
	while ((Mount_Data = getmntent(Mount_Records)) != NULL) {
117
	while ((Mount_Data = getmntent(Mount_Records)) != NULL) {
116
		/* save root file system type for later, if needed */
118
		/* save root file system type for later, if needed */
117
		if (strcmp(ROOT_DIR, Mount_Data->mnt_dir) == 0)
119
		if (strcmp(ROOT_DIR, Mount_Data->mnt_dir) == 0)
118
			strcpy(Root_FS_Type, Mount_Data->mnt_type);
120
			strncpy(Root_FS_Type, Mount_Data->mnt_type, sizeof(Root_FS_Type) - 1);
119
		if (strcmp(Device_Name, Mount_Data->mnt_fsname) == 0)
121
		if (strcmp(Device_Name, Mount_Data->mnt_fsname) == 0)
120
			break;
122
			break;
121
	}
123
	}
Lines 141-148 Link Here
141
				 * Make a best effort to ensure that
143
				 * Make a best effort to ensure that
142
				 * the root file system type is jfs
144
				 * the root file system type is jfs
143
				 */
145
				 */
144
				if ((strcmp(Root_FS_Type, "0000000") != '0') &&
146
				if (strncmp(Root_FS_Type, "jfs", sizeof(Root_FS_Type) - 1) != 0)
145
				    (strcmp(Root_FS_Type, "jfs") != 0))
146
					/* is mounted, found type, is not type jfs */
147
					/* is mounted, found type, is not type jfs */
147
					Mounted_RC = MSG_JFS_NOT_JFS;
148
					Mounted_RC = MSG_JFS_NOT_JFS;
148
			}
149
			}

Return to bug 116950