mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
Make it work for FreeBSD-2.1.
This commit is contained in:
parent
bc09b98dbc
commit
602e098fc1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13052
1 changed files with 8 additions and 21 deletions
|
@ -51,7 +51,7 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <dev/ccdvar.h>
|
||||
#include <sys/ccdvar.h>
|
||||
|
||||
#include "pathnames.h"
|
||||
|
||||
|
@ -622,31 +622,13 @@ print_ccd_info(cs, kd)
|
|||
static int
|
||||
getmaxpartitions()
|
||||
{
|
||||
int maxpart, mib[2];
|
||||
size_t varlen;
|
||||
|
||||
mib[0] = CTL_KERN;
|
||||
mib[1] = KERN_MAXPARTITIONS;
|
||||
varlen = sizeof(maxpart);
|
||||
if (sysctl(mib, 2, &maxpart, &varlen, NULL, 0) < 0)
|
||||
return (-1);
|
||||
|
||||
return (maxpart);
|
||||
return (MAXPARTITIONS);
|
||||
}
|
||||
|
||||
static int
|
||||
getrawpartition()
|
||||
{
|
||||
int rawpart, mib[2];
|
||||
size_t varlen;
|
||||
|
||||
mib[0] = CTL_KERN;
|
||||
mib[1] = KERN_RAWPARTITION;
|
||||
varlen = sizeof(rawpart);
|
||||
if (sysctl(mib, 2, &rawpart, &varlen, NULL, 0) < 0)
|
||||
return (-1);
|
||||
|
||||
return (rawpart);
|
||||
return (RAW_PART);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -721,3 +703,8 @@ usage()
|
|||
"[ccd [...]]");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Local Variables: */
|
||||
/* c-argdecl-indent: 8 */
|
||||
/* c-indent-level: 8 */
|
||||
/* End: */
|
||||
|
|
Loading…
Reference in a new issue