*/
#include <config.h>
-
+#include <unistd.h>
#include <math.h>
-#ifdef _WIN32
-#include <io.h>
-#endif
#include "commands.h"
#include "item.h"
return;
for (i = 0; i < MAXNOC; i++)
putpower(i, &powbuf[i]);
-#ifdef _WIN32
/*
- * At least some versions of Windows fail to update mtime on
- * write(). Bad, because `power' displays that time. Attempt to
- * force an update.
+ * At least some versions of Windows fail to update st_mtime on
+ * write(), the st_mtime is not until the file is written to the
+ * disk. Bad, because `power' displays that time.
+ * Force a sync to ensure the st_time is correct.
*/
- _commit(empfile[EF_POWER].fd);
-#endif
+ fsync(empfile[EF_POWER].fd);
}
static int