SCCS-vsn: sbin/dump/dumprmt.c 1.2
-static char *sccsid = "@(#)dumprmt.c 1.1 (Berkeley) %G%";
-#include "dump.h"
+static char *sccsid = "@(#)dumprmt.c 1.2 (Berkeley) %G%";
+#include <stdio.h>
+#include <sys/param.h>
#include <sys/mtio.h>
#include <sys/ioctl.h>
#include <net/in.h>
#include <sys/mtio.h>
#include <sys/ioctl.h>
#include <net/in.h>
sigset(SIGPIPE, rmtconnaborted);
rmtgetconn();
if (rmtape < 0)
sigset(SIGPIPE, rmtconnaborted);
rmtgetconn();
if (rmtape < 0)
- msg("Lost connection to tape server.\n");
- if (rmtape >= 0) {
- close(rmtape);
- rmtape = -1;
- }
- exit(X_REWRITE);
-}
-
-rmtreconnect()
-{
-
- do {
- if (query("Retry conection to remote host?") == 0)
- exit(X_ABORT);
- rmtgetconn();
- } while (rmtape < 0);
+ fprintf(stderr, "Lost connection to remote host.\n");
+ exit(1);
{
char line[30];
int n, i, cc;
{
char line[30];
int n, i, cc;
sprintf(line, "R%d\n", count);
n = rmtcall("read", line);
sprintf(line, "R%d\n", count);
n = rmtcall("read", line);
+ if (n < 0) {
+ errno = n;
for (i = 0; i < n; i += cc) {
cc = read(rmtape, buf+i, n - i);
for (i = 0; i < n; i += cc) {
cc = read(rmtape, buf+i, n - i);
msg("Protocol to remote tape server botched (in rmtgets).\n");
rmtconnaborted();
}
msg("Protocol to remote tape server botched (in rmtgets).\n");
rmtconnaborted();
}
+
+msg(cp, a1, a2, a3)
+ char *cp;
+{
+
+ fprintf(stderr, cp, a1, a2, a3);
+}