-/* $NetBSD: sync.c,v 1.15 2001/01/01 21:57:38 jwise Exp $ */
+/* $NetBSD: sync.c,v 1.18 2001/01/04 03:51:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)sync.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: sync.c,v 1.15 2001/01/01 21:57:38 jwise Exp $");
+__RCSID("$NetBSD: sync.c,v 1.18 2001/01/04 03:51:24 jwise Exp $");
#endif
#endif /* not lint */
#include <fcntl.h>
#include <errno.h>
-#ifdef __STDC__
+#include <signal.h>
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
+#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#include <string.h>
#include <time.h>
+#include <unistd.h>
#include "extern.h"
#include "pathnames.h"
#define BUFSIZE 4096
+void fmtship(char *, size_t, const char *, struct ship *);
+void makesignal(struct ship *, const char *, struct ship *, ...);
+void makemsg(struct ship *, const char *, ...);
+int sync_exists(int);
+int sync_open(void);
+void sync_close(int);
+void Write(int, struct ship *, long, long, long, long);
+void Writestr(int, struct ship *, const char *);
+int Sync(void);
+static int sync_update(int, struct ship *, const char *, long, long, long, long);
+
static const char SF[] = _PATH_SYNC;
static const char LF[] = _PATH_LOCK;
static char sync_buf[BUFSIZE];
return erred ? -1 : 0;
}
-int
+static int
sync_update(int type, struct ship *ship, const char *astr, long a, long b, long c, long d)
{
switch (type) {