return of venti
This commit is contained in:
parent
88bb285e3d
commit
a0d146edd7
68 changed files with 14443 additions and 2 deletions
54
src/cmd/venti/sync.c
Normal file
54
src/cmd/venti/sync.c
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <thread.h>
|
||||
#include <venti.h>
|
||||
|
||||
char *host;
|
||||
int donothing;
|
||||
|
||||
void
|
||||
usage(void)
|
||||
{
|
||||
fprint(2, "usage: sync [-h host]\n");
|
||||
threadexitsall("usage");
|
||||
}
|
||||
|
||||
void
|
||||
threadmain(int argc, char *argv[])
|
||||
{
|
||||
VtConn *z;
|
||||
|
||||
fmtinstall('V', vtscorefmt);
|
||||
fmtinstall('F', vtfcallfmt);
|
||||
|
||||
ARGBEGIN{
|
||||
case 'h':
|
||||
host = EARGF(usage());
|
||||
if(host == nil)
|
||||
usage();
|
||||
break;
|
||||
case 'x':
|
||||
donothing = 1;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
}ARGEND
|
||||
|
||||
if(argc != 0)
|
||||
usage();
|
||||
|
||||
z = vtdial(host);
|
||||
if(z == nil)
|
||||
sysfatal("could not connect to server: %r");
|
||||
|
||||
if(vtconnect(z) < 0)
|
||||
sysfatal("vtconnect: %r");
|
||||
|
||||
if(!donothing)
|
||||
if(vtsync(z) < 0)
|
||||
sysfatal("vtsync: %r");
|
||||
|
||||
vthangup(z);
|
||||
threadexitsall(0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue