Changeset View
Changeset View
Standalone View
Standalone View
head/sys/geom/vinum/geom_vinum_share.c
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <geom/geom.h> | #include <geom/geom.h> | ||||
#define iswhite(c) (((c) == ' ') || ((c) == '\t')) | #define iswhite(c) (((c) == ' ') || ((c) == '\t')) | ||||
#else | #else | ||||
#include <ctype.h> | #include <ctype.h> | ||||
#include <paths.h> | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#define iswhite isspace | #define iswhite isspace | ||||
#define g_free free | #define g_free free | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
▲ Show 20 Lines • Show All 396 Lines • ▼ Show 20 Lines | for (j = 1; j < max; j++) { | ||||
} else if (!strcmp(token[j], "device")) { | } else if (!strcmp(token[j], "device")) { | ||||
j++; | j++; | ||||
if (j >= max) { | if (j >= max) { | ||||
errors++; | errors++; | ||||
break; | break; | ||||
} | } | ||||
ptr = token[j]; | ptr = token[j]; | ||||
if (strncmp(ptr, "/dev/", 5) == 0) | if (strncmp(ptr, _PATH_DEV, 5) == 0) | ||||
ptr += 5; | ptr += 5; | ||||
strlcpy(d->device, ptr, sizeof(d->device)); | strlcpy(d->device, ptr, sizeof(d->device)); | ||||
} else { | } else { | ||||
/* We assume this is the drive name. */ | /* We assume this is the drive name. */ | ||||
strlcpy(d->name, token[j], sizeof(d->name)); | strlcpy(d->name, token[j], sizeof(d->name)); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 253 Lines • Show Last 20 Lines |