From ba75006b67ac9dc3a4ab45f7d4e8b787cd350221 Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Fri, 22 May 2009 00:01:27 +0000 Subject: [PATCH] Use explicit dir_write() instead of letting dir_close() do the writing. This is to prepare for an updating version to deal with SFTs. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1391 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/fatdir.c | 5 ----- kernel/fatfs.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/fatdir.c b/kernel/fatdir.c index fa624ee..832b506 100644 --- a/kernel/fatdir.c +++ b/kernel/fatdir.c @@ -289,11 +289,6 @@ VOID dir_close(REG f_node_ptr fnp) if (fnp == NULL || !(fnp->f_flags & F_DDIR)) return; -#ifndef IPL - /* Write out the entry */ - dir_write(fnp); - -#endif /* Clear buffers after release */ /* hazard: no error checking! */ flush_buffers(fnp->f_dpb->dpb_unit); diff --git a/kernel/fatfs.c b/kernel/fatfs.c index 162775b..8ce34f1 100644 --- a/kernel/fatfs.c +++ b/kernel/fatfs.c @@ -279,6 +279,7 @@ COUNT dos_close(COUNT fd) } fnp->f_flags |= F_DDIR; + dir_write(fnp); dir_close(fnp); return SUCCESS; } @@ -519,6 +520,7 @@ STATIC COUNT delete_dir_entry(f_node_ptr fnp) /* bit before closing it, allowing it to be */ /* updated */ fnp->f_flags |= F_DMOD; + dir_write(fnp); dir_close(fnp); /* SUCCESSful completion, return it */ @@ -728,7 +730,9 @@ COUNT dos_rename(BYTE * path1, BYTE * path2, int attrib) /* Ok, so we can delete this one. Save the file info. */ *(fnp1->f_dir.dir_name) = DELETED; + dir_write(fnp1); dir_close(fnp1); + dir_write(fnp2); dir_close(fnp2); /* SUCCESSful completion, return it */ @@ -1169,6 +1173,7 @@ COUNT dos_mkdir(BYTE * dir) /* Close the directory so that the entry is updated */ fnp->f_flags |= F_DMOD; + dir_write(fnp); dir_close(fnp); return SUCCESS;