commit db0efaeff1a3170cb89aef4107e902c3c0123a9c
parent 5b3b08e52669ac969f7beac7a09354774ac74f60
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date: Sun, 7 Nov 2021 00:51:42 +0000
Drop redundant dirfd
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/devices/file.c b/src/devices/file.c
@@ -24,7 +24,6 @@ WITH REGARD TO THIS SOFTWARE.
static FILE *f;
static DIR *d;
-static int dir_fd;
static char *current_filename = "";
static enum { IDLE,
FILE_READ,
@@ -82,10 +81,9 @@ file_read(void *dest, Uint16 len)
{
if(state != FILE_READ && state != DIR_READ) {
reset();
- if((d = opendir(current_filename)) != NULL) {
+ if((d = opendir(current_filename)) != NULL)
state = DIR_READ;
- dir_fd = dirfd(d);
- } else if((f = fopen(current_filename, "rb")) != NULL)
+ else if((f = fopen(current_filename, "rb")) != NULL)
state = FILE_READ;
}
if(state == FILE_READ)