clang-format

This commit is contained in:
2024-09-10 13:03:02 -04:00
parent 53c617d779
commit d66450e427
381 changed files with 28864 additions and 34170 deletions

View File

@@ -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;
}