(gen_power) [!_WIN32]: Previous revision inserted fsync(), where

previously something equivalent was done only for _WIN32.  Revert
that.
This commit is contained in:
Markus Armbruster 2007-08-24 17:22:12 +00:00
parent 8d8c6972a1
commit c940c76a01

View file

@ -314,13 +314,14 @@ gen_power(struct powstr *powbuf, int save)
return; return;
for (i = 0; i < MAXNOC; i++) for (i = 0; i < MAXNOC; i++)
putpower(i, &powbuf[i]); putpower(i, &powbuf[i]);
#ifdef _WIN32
/* /*
* At least some versions of Windows fail to update st_mtime on * At least some versions of Windows fail to update mtime on
* write(), the st_mtime is not until the file is written to the * write(), they delay it until the write actually hits the disk.
* disk. Bad, because `power' displays that time. * Bad, because `power' displays that time. Force it.
* Force a sync to ensure the st_time is correct.
*/ */
fsync(empfile[EF_POWER].fd); fsync(empfile[EF_POWER].fd);
#endif
} }
static int static int