Drop redundant dirfd
This commit is contained in:
parent
5b3b08e526
commit
db0efaeff1
|
@ -24,7 +24,6 @@ WITH REGARD TO THIS SOFTWARE.
|
||||||
|
|
||||||
static FILE *f;
|
static FILE *f;
|
||||||
static DIR *d;
|
static DIR *d;
|
||||||
static int dir_fd;
|
|
||||||
static char *current_filename = "";
|
static char *current_filename = "";
|
||||||
static enum { IDLE,
|
static enum { IDLE,
|
||||||
FILE_READ,
|
FILE_READ,
|
||||||
|
@ -82,10 +81,9 @@ file_read(void *dest, Uint16 len)
|
||||||
{
|
{
|
||||||
if(state != FILE_READ && state != DIR_READ) {
|
if(state != FILE_READ && state != DIR_READ) {
|
||||||
reset();
|
reset();
|
||||||
if((d = opendir(current_filename)) != NULL) {
|
if((d = opendir(current_filename)) != NULL)
|
||||||
state = DIR_READ;
|
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;
|
state = FILE_READ;
|
||||||
}
|
}
|
||||||
if(state == FILE_READ)
|
if(state == FILE_READ)
|
||||||
|
|
Loading…
Reference in New Issue