clang-format
This commit is contained in:
@@ -34,29 +34,25 @@
|
||||
/*
|
||||
* Like strdup, but calls kmalloc.
|
||||
*/
|
||||
char *
|
||||
kstrdup(const char *s)
|
||||
{
|
||||
char *z;
|
||||
char *kstrdup(const char *s) {
|
||||
char *z;
|
||||
|
||||
z = kmalloc(strlen(s)+1);
|
||||
if (z == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
strcpy(z, s);
|
||||
return z;
|
||||
z = kmalloc(strlen(s) + 1);
|
||||
if (z == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
strcpy(z, s);
|
||||
return z;
|
||||
}
|
||||
|
||||
/*
|
||||
* Standard C function to return a string for a given errno.
|
||||
* Kernel version; panics if it hits an unknown error.
|
||||
*/
|
||||
const char *
|
||||
strerror(int errcode)
|
||||
{
|
||||
if (errcode>=0 && errcode < sys_nerr) {
|
||||
return sys_errlist[errcode];
|
||||
}
|
||||
panic("Invalid error code %d\n", errcode);
|
||||
return NULL;
|
||||
const char *strerror(int errcode) {
|
||||
if (errcode >= 0 && errcode < sys_nerr) {
|
||||
return sys_errlist[errcode];
|
||||
}
|
||||
panic("Invalid error code %d\n", errcode);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user