fs: take const descriptor in open_generic()

This commit is contained in:
Lephe 2024-03-19 19:03:33 +01:00
parent 5ff6a518f6
commit b2b1f00d04
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495
2 changed files with 3 additions and 3 deletions

View file

@ -78,7 +78,7 @@ void fs_free_descriptor(int fd);
exact file descriptor reuse_fd is used. (This is useful to reopen standard
streams.) In this case, the only possible return values are -1 and reuse_fd
itself. */
int open_generic(fs_descriptor_type_t *type, void *data, int reuse_fd);
int open_generic(fs_descriptor_type_t const *type, void *data, int reuse_fd);
/* fs_path_normalize(): Normalize a path to eliminate ., .. and redundant /

View file

@ -42,7 +42,7 @@ void fs_free_descriptor(int fd)
fdtable[fd].data = NULL;
}
int open_generic(fs_descriptor_type_t *type, void *data, int fd)
int open_generic(fs_descriptor_type_t const *type, void *data, int fd)
{
if(!fdtable) {
errno = ENOMEM;
@ -79,7 +79,7 @@ int open_generic(fs_descriptor_type_t *type, void *data, int fd)
/* Standard streams */
static fs_descriptor_type_t devnull = {
static fs_descriptor_type_t const devnull = {
.read = NULL,
.write = NULL,
.lseek = NULL,