Garbage-collected hotroot, rawname() and unrawname() again. These
became garbage when block devices were axed and were removed a few months later, but they came back (with hotroot renamed to hot + hotroot()) when the NetBSD fsck was mismerged.
This commit is contained in:
parent
ccf8fdfdee
commit
e73943dcf6
@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include "fsutil.h"
|
||||
|
||||
static const char *dev = NULL;
|
||||
static int hot = 0;
|
||||
static int preen = 0;
|
||||
|
||||
static void vmsg(int, const char *, va_list) __printflike(2, 0);
|
||||
@ -73,12 +72,6 @@ cdevname(void)
|
||||
return dev;
|
||||
}
|
||||
|
||||
int
|
||||
hotroot(void)
|
||||
{
|
||||
return hot;
|
||||
}
|
||||
|
||||
static void
|
||||
vmsg(int fatal, const char *fmt, va_list ap)
|
||||
{
|
||||
@ -137,37 +130,6 @@ panic(const char *fmt, ...)
|
||||
exit(8);
|
||||
}
|
||||
|
||||
const char *
|
||||
unrawname(const char *name)
|
||||
{
|
||||
static char unrawbuf[32];
|
||||
const char *dp;
|
||||
struct stat stb;
|
||||
|
||||
if ((dp = strrchr(name, '/')) == 0)
|
||||
return (name);
|
||||
if (stat(name, &stb) < 0)
|
||||
return (name);
|
||||
if (!S_ISCHR(stb.st_mode))
|
||||
return (name);
|
||||
if (dp[1] != 'r')
|
||||
return (name);
|
||||
(void)snprintf(unrawbuf, 32, "%.*s/%s", (int)(dp - name), name, dp + 2);
|
||||
return (unrawbuf);
|
||||
}
|
||||
|
||||
const char *
|
||||
rawname(const char *name)
|
||||
{
|
||||
static char rawbuf[32];
|
||||
const char *dp;
|
||||
|
||||
if ((dp = strrchr(name, '/')) == 0)
|
||||
return (0);
|
||||
(void)snprintf(rawbuf, 32, "%.*s/r%s", (int)(dp - name), name, dp + 1);
|
||||
return (rawbuf);
|
||||
}
|
||||
|
||||
const char *
|
||||
devcheck(const char *origname)
|
||||
{
|
||||
|
@ -37,13 +37,10 @@ void pwarn(const char *, ...)
|
||||
__attribute__((__format__(__printf__,1,2)));
|
||||
void panic(const char *, ...)
|
||||
__attribute__((__noreturn__,__format__(__printf__,1,2)));
|
||||
const char *rawname(const char *);
|
||||
const char *unrawname(const char *);
|
||||
const char *devcheck(const char *);
|
||||
const char *cdevname(void);
|
||||
void setcdevname(const char *, int);
|
||||
struct statfs *getmntpt(const char *);
|
||||
int hotroot(void);
|
||||
void *emalloc(size_t);
|
||||
void *erealloc(void *, size_t);
|
||||
char *estrdup(const char *);
|
||||
|
Loading…
Reference in New Issue
Block a user