diff options
author | dzwdz | 2023-01-25 20:16:22 +0100 |
---|---|---|
committer | dzwdz | 2023-01-25 20:16:22 +0100 |
commit | 17bfb0ef0a48330b1d54e61fe3c30d83528d2d90 (patch) | |
tree | b3d4aed1f408edcb17fe5c86fccaeacaa2a5a48a /src/user/lib/fs/whitelist.c | |
parent | 2ad6ee8ed15d1bf898645a16dbc06991a3c1425e (diff) |
style: typedef structs, shorter namespaces
I've wanted to do this for a while, and since I've just had a relatively
large refactor commit (pcpy), this is as good of a time as any.
Typedefing structs was mostly inspired by Plan 9's coding style. It makes
some lines of code much shorter at basically no expense.
Everything related to userland kept old-style struct definitions, so as not
to force that style onto other people.
I also considered changing SCREAMING_ENUM_FIELDS to NicerLookingCamelcase,
but I didn't, just in case that'd be confusing.
Diffstat (limited to 'src/user/lib/fs/whitelist.c')
-rw-r--r-- | src/user/lib/fs/whitelist.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/user/lib/fs/whitelist.c b/src/user/lib/fs/whitelist.c index 5612d9a..54a79c3 100644 --- a/src/user/lib/fs/whitelist.c +++ b/src/user/lib/fs/whitelist.c @@ -43,7 +43,7 @@ void fs_whitelist(const char **whitelist) { if (!buf) exit(1); for (;;) { struct ufs_request res; - handle_t reqh = _syscall_fs_wait(buf, buflen, &res); + hid_t reqh = _sys_fs_wait(buf, buflen, &res); if (reqh < 0) break; char *ipath = res.id; /* the path of the open()ed directory */ @@ -70,7 +70,7 @@ void fs_whitelist(const char **whitelist) { } } if (error) { - _syscall_fs_respond(reqh, NULL, -EACCES, 0); + _sys_fs_respond(reqh, NULL, -EACCES, 0); } else if (passthru) { forward_open(reqh, buf, res.len, res.flags); } else if (inject) { @@ -78,9 +78,9 @@ void fs_whitelist(const char **whitelist) { ipath = malloc(res.len + 1); memcpy(ipath, buf, res.len); ipath[res.len] = '\0'; - _syscall_fs_respond(reqh, ipath, 0, 0); + _sys_fs_respond(reqh, ipath, 0, 0); } else { - _syscall_fs_respond(reqh, NULL, -1, 0); + _sys_fs_respond(reqh, NULL, -1, 0); } break; } @@ -96,16 +96,16 @@ void fs_whitelist(const char **whitelist) { if (ilen < elen && !memcmp(ipath, *entry, ilen)) dir_appendl(&db, *entry + ilen, dir_seglen2(*entry + ilen, elen - ilen)); } - _syscall_fs_respond(reqh, target, dir_finish(&db), 0); + _sys_fs_respond(reqh, target, dir_finish(&db), 0); break; } case VFSOP_CLOSE: { free(ipath); - _syscall_fs_respond(reqh, NULL, 0, 0); + _sys_fs_respond(reqh, NULL, 0, 0); break; } default: { - _syscall_fs_respond(reqh, NULL, -1, 0); + _sys_fs_respond(reqh, NULL, -1, 0); break; } } |