version 1.22.4.1, 2001/10/27 19:19:14 |
version 1.26, 2005/11/29 03:11:59 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* documentation and/or other materials provided with the distribution. |
* 3. All advertising materials mentioning features or use of this software |
* 3. Neither the name of the University nor the names of its contributors |
* must display the following acknowledgement: |
|
* This product includes software developed by the University of |
|
* California, Berkeley and its contributors. |
|
* 4. Neither the name of the University nor the names of its contributors |
|
* may be used to endorse or promote products derived from this software |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* without specific prior written permission. |
* |
* |
|
|
char subline[MAXLINELENGTH]; |
char subline[MAXLINELENGTH]; |
static const char sep[] = ":\n"; |
static const char sep[] = ":\n"; |
static const char ws[] = " \t\n"; |
static const char ws[] = " \t\n"; |
static char *fstab_type[] = { |
static const char *fstab_type[] = { |
FSTAB_RW, FSTAB_RQ, FSTAB_RO, FSTAB_SW, FSTAB_DP, FSTAB_XX, NULL |
FSTAB_RW, FSTAB_RQ, FSTAB_RO, FSTAB_SW, FSTAB_DP, FSTAB_XX, NULL |
}; |
}; |
|
|
|
|
continue; |
continue; |
_fs_fstab.fs_mntops = _fs_fstab.fs_type; |
_fs_fstab.fs_mntops = _fs_fstab.fs_type; |
_fs_fstab.fs_vfstype = |
_fs_fstab.fs_vfstype = |
|
__UNCONST( |
strcmp(_fs_fstab.fs_type, FSTAB_SW) ? |
strcmp(_fs_fstab.fs_type, FSTAB_SW) ? |
"ufs" : "swap"; |
"ufs" : "swap"); |
if ((cp = nextfld(&lp, sep)) != NULL) { |
if ((cp = nextfld(&lp, sep)) != NULL) { |
_fs_fstab.fs_freq = atoi(cp); |
_fs_fstab.fs_freq = atoi(cp); |
if ((cp = nextfld(&lp, sep)) != NULL) { |
if ((cp = nextfld(&lp, sep)) != NULL) { |
|
|
if ((cp = nextfld(&lp, ws)) != NULL) |
if ((cp = nextfld(&lp, ws)) != NULL) |
_fs_fstab.fs_passno = atoi(cp); |
_fs_fstab.fs_passno = atoi(cp); |
} |
} |
sp = strncpy(subline, _fs_fstab.fs_mntops, sizeof(subline)-1); |
|
|
/* subline truncated iff line truncated */ |
|
(void)strlcpy(subline, _fs_fstab.fs_mntops, sizeof(subline)); |
|
sp = subline; |
|
|
while ((cp = nextfld(&sp, ",")) != NULL) { |
while ((cp = nextfld(&sp, ",")) != NULL) { |
char **tp; |
const char **tp; |
|
|
if (strlen(cp) != 2) |
if (strlen(cp) != 2) |
continue; |
continue; |
|
|
for (tp = fstab_type; *tp; tp++) |
for (tp = fstab_type; *tp; tp++) |
if (strcmp(cp, *tp) == 0) { |
if (strcmp(cp, *tp) == 0) { |
_fs_fstab.fs_type = *tp; |
_fs_fstab.fs_type = __UNCONST(*tp); |
break; |
break; |
} |
} |
if (*tp) |
if (*tp) |