.name = "none",
};
+static const struct file_ops file_file_ops = {
+ .name = "file",
+ .lseek = lseek_default,
+};
+
#ifdef HAVE_LWIP
static int socket_read(struct file *file, void *buf, size_t nbytes)
{
#ifdef CONFIG_CONSFRONT
[FTYPE_CONSOLE] = &console_ops,
#endif
+ [FTYPE_FILE] = &file_file_ops,
#ifdef HAVE_LWIP
[FTYPE_SOCKET] = &socket_ops,
#endif
if ( ops->lseek )
return ops->lseek(file, offset, whence);
- switch(file->type) {
- case FTYPE_FILE:
- break;
- default:
- /* Not implemented for this filetype */
- errno = ESPIPE;
- return (off_t) -1;
- }
-
- return lseek_default(file, offset, whence);
+ /* Not implemented for this filetype */
+ errno = ESPIPE;
+ return (off_t) -1;
}
int fsync(int fd) {