summaryrefslogtreecommitdiff
path: root/gnu/libexec/uucp/libunix/sync.c
blob: c346c58ccb7adcc03ffbf7d79868333e033fb751 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* sync.c
   Sync a file to disk, if FSYNC_ON_CLOSE is set.  */

#include "uucp.h"

#include "uudefs.h"
#include "sysdep.h"
#include "system.h"

#include <errno.h>

boolean
fsysdep_sync (e, zmsg)
     openfile_t e;
     const char *zmsg;
{
  int o;

#if USE_STDIO
  if (fflush (e) == EOF)
    {
      ulog (LOG_ERROR, "%s: fflush: %s", zmsg, strerror (errno));
      return FALSE;
    }
#endif

#if USE_STDIO
  o = fileno (e);
#else
  o = e;
#endif

#if FSYNC_ON_CLOSE
  if (fsync (o) < 0)
    {
      ulog (LOG_ERROR, "%s: fsync: %s", zmsg, strerror (errno));
      return FALSE;
    }
#endif

  return TRUE;
}
/netbsd/commit/usr.bin/awk?id=aded0d2cce349c0f60a700ad14f89963937cfa2c'>Whitespace cleanup.wiz 2001-10-19Add -msoft-quad-float on sparc64 to work around toolchain/kernel fpumartin 2001-07-08one morejdolecek 2001-02-08document systime(), strftime(), gensub(); for gensub(), note that the \njdolecek 2001-02-08strftime(), systime() added, gensub() partly donejdolecek 2001-02-05group all operators to subsection Operators, describe what eachjdolecek 2001-02-05document supported options better, add a short info aboutjdolecek 2001-02-04substr(): the argument 'n' is optional, document what happens if it's omittedjdolecek 2001-02-02add a list of things GNU awk has and we probably want to supportjdolecek 2001-01-30Do extensive facelift:jdolecek 2001-01-30Conversion of nawk manpage to mdoc format. Put here rather thanjdolecek 2001-01-23use YHEADER instead YFLAGS/CLEANFILESjdolecek 2001-01-23Add nawk build glue. It's not enabled for now, gawk is still the default.jdolecek