blob: 7446140062c3b79799d88a65dc80b59a1c6f3b8c (
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
43
44
45
46
47
48
|
#include "stdinc.h"
#include "dat.h"
#include "fns.h"
char *host;
void
usage(void)
{
fprint(2, "usage: sync [-h host]\n");
threadexitsall("usage");
}
void
threadmain(int argc, char *argv[])
{
VtConn *z;
ARGBEGIN{
case 'h':
host = EARGF(usage());
if(host == nil)
usage();
break;
default:
usage();
break;
}ARGEND
if(argc != 0)
usage();
fmtinstall('V', vtscorefmt);
z = vtdial(host);
if(z == nil)
sysfatal("could not connect to server: %r");
if(vtconnect(z) < 0)
sysfatal("vtconnect: %r");
if(vtsync(z) < 0)
sysfatal("vtsync: %r");
vthangup(z);
threadexitsall(0);
}
|