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:
Bart Oldeman 2009-06-18 16:42:03 +00:00
parent 4d3e2e2fad
commit 6aa1e45bd8

View File

@ -183,10 +183,11 @@ int dos_open(char *path, unsigned flags, unsigned attrib, int fd)
fnp->f_offset = 0l; fnp->f_offset = 0l;
fnp->f_cluster_offset = 0; fnp->f_cluster_offset = 0;
fnp->f_flags &= ~(SFT_FDATE|SFT_FCLEAN); fnp->f_flags &= ~SFT_FDATE;
if (status == S_OPENED) /* use FCLEAN even on replaced/created files: the bit is reset */
fnp->f_flags |= SFT_FCLEAN; /* if the file is written to later */
else fnp->f_flags |= SFT_FCLEAN;
if (status != S_OPENED)
{ {
init_direntry(&fnp->f_dir, attrib, FREE, fnp->f_dmp->dm_name_pat); init_direntry(&fnp->f_dir, attrib, FREE, fnp->f_dmp->dm_name_pat);
if (!dir_write(fnp)) if (!dir_write(fnp))