mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-23 13:54:30 +02:00
Set the clean bit also on created/replaced files, not just opened files, so
the directory entry is only updated after they are written too. Fixes SF bug #2380531. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1453 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
4d3e2e2fad
commit
6aa1e45bd8
@ -183,10 +183,11 @@ int dos_open(char *path, unsigned flags, unsigned attrib, int fd)
|
||||
fnp->f_offset = 0l;
|
||||
fnp->f_cluster_offset = 0;
|
||||
|
||||
fnp->f_flags &= ~(SFT_FDATE|SFT_FCLEAN);
|
||||
if (status == S_OPENED)
|
||||
fnp->f_flags |= SFT_FCLEAN;
|
||||
else
|
||||
fnp->f_flags &= ~SFT_FDATE;
|
||||
/* use FCLEAN even on replaced/created files: the bit is reset */
|
||||
/* if the file is written to later */
|
||||
fnp->f_flags |= SFT_FCLEAN;
|
||||
if (status != S_OPENED)
|
||||
{
|
||||
init_direntry(&fnp->f_dir, attrib, FREE, fnp->f_dmp->dm_name_pat);
|
||||
if (!dir_write(fnp))
|
||||
|
Loading…
x
Reference in New Issue
Block a user