freemyipod r481 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r480‎ | r481 | r482 >
Date:15:18, 22 January 2011
Author:theseven
Status:new
Tags:
Comment:
emCORE: Fix remove()
Modified paths:
  • /emcore/trunk/file.c (modified) (history)

Diff [purge]

Index: emcore/trunk/file.c
@@ -292,13 +292,12 @@
293293 int remove(const char* name)
294294 {
295295 int rc;
296 - struct filedesc* file;
297296 /* Can't use dircache now, because we need to access the fat structures. */
298297 int fd = open_internal(name, O_WRONLY, false);
299298 if ( fd < 0 )
300299 return fd * 10 - 1;
301300
302 - file = &openfiles[fd];
 301+ struct filedesc* file = (struct filedesc*)fd;
303302 rc = fat_remove(&(file->fatfile));
304303 if ( rc < 0 ) {
305304 DEBUGF("Failed removing file: %d", rc);