Changeset View
Changeset View
Standalone View
Standalone View
sbin/newfs_msdos/newfs_msdos.c
Context not available. | |||||
{ | { | ||||
static const char opts[] = "@:NB:C:F:I:L:O:S:a:b:c:e:f:h:i:k:m:n:o:r:s:u:"; | static const char opts[] = "@:NB:C:F:I:L:O:S:a:b:c:e:f:h:i:k:m:n:o:r:s:u:"; | ||||
struct msdos_options o; | struct msdos_options o; | ||||
const char *fname, *dtype; | char *fname; | ||||
const char *dtype; | |||||
char buf[MAXPATHLEN]; | char buf[MAXPATHLEN]; | ||||
int ch; | int ch; | ||||
int local_fname = 0; | |||||
int ret; | |||||
memset(&o, 0, sizeof(o)); | memset(&o, 0, sizeof(o)); | ||||
Context not available. | |||||
snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname); | snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname); | ||||
if (!(fname = strdup(buf))) | if (!(fname = strdup(buf))) | ||||
err(1, NULL); | err(1, NULL); | ||||
local_fname = 1; | |||||
} | } | ||||
dtype = *argv; | dtype = *argv; | ||||
return !!mkfs_msdos(fname, dtype, &o); | ret = !!mkfs_msdos(fname, dtype, &o); | ||||
if (local_fname) | |||||
free(fname); | |||||
return ret; | |||||
} | } | ||||
/* | /* | ||||
Context not available. |