allow
sam -r machine filelist... from presotto
This commit is contained in:
parent
f1bfc54e12
commit
8538a66037
3 changed files with 25 additions and 6 deletions
|
|
@ -219,10 +219,28 @@ bootterm(char *machine, char **argv, char **end)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
connectto(char *machine)
|
connectto(char *machine, char **argv)
|
||||||
{
|
{
|
||||||
int p1[2], p2[2];
|
int p1[2], p2[2];
|
||||||
|
char **av;
|
||||||
|
int ac;
|
||||||
|
|
||||||
|
// count args
|
||||||
|
for(av = argv; *av; av++)
|
||||||
|
;
|
||||||
|
av = malloc(sizeof(char*)*((av-argv) + 5));
|
||||||
|
if(av == nil){
|
||||||
|
dprint("out of memory\n");
|
||||||
|
exits("fork/exec");
|
||||||
|
}
|
||||||
|
ac = 0;
|
||||||
|
av[ac++] = RX;
|
||||||
|
av[ac++] = machine;
|
||||||
|
av[ac++] = rsamname;
|
||||||
|
av[ac++] = "-R";
|
||||||
|
while(*argv)
|
||||||
|
av[ac++] = *argv++;
|
||||||
|
av[ac] = 0;
|
||||||
if(pipe(p1)<0 || pipe(p2)<0){
|
if(pipe(p1)<0 || pipe(p2)<0){
|
||||||
dprint("can't pipe\n");
|
dprint("can't pipe\n");
|
||||||
exits("pipe");
|
exits("pipe");
|
||||||
|
|
@ -237,7 +255,7 @@ connectto(char *machine)
|
||||||
close(p1[1]);
|
close(p1[1]);
|
||||||
close(p2[0]);
|
close(p2[0]);
|
||||||
close(p2[1]);
|
close(p2[1]);
|
||||||
execlp(RXPATH, RX, machine, rsamname, "-R", (char*)0);
|
execvp(RXPATH, av);
|
||||||
dprint("can't exec %s\n", RXPATH);
|
dprint("can't exec %s\n", RXPATH);
|
||||||
exits("exec");
|
exits("exec");
|
||||||
|
|
||||||
|
|
@ -245,15 +263,16 @@ connectto(char *machine)
|
||||||
dprint("can't fork\n");
|
dprint("can't fork\n");
|
||||||
exits("fork");
|
exits("fork");
|
||||||
}
|
}
|
||||||
|
free(av);
|
||||||
close(p1[1]);
|
close(p1[1]);
|
||||||
close(p2[0]);
|
close(p2[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
startup(char *machine, int Rflag, char **argv, char **end)
|
startup(char *machine, int Rflag, char **argv, char **end, char **files)
|
||||||
{
|
{
|
||||||
if(machine)
|
if(machine)
|
||||||
connectto(machine);
|
connectto(machine, files);
|
||||||
if(!Rflag)
|
if(!Rflag)
|
||||||
bootterm(machine, argv, end);
|
bootterm(machine, argv, end);
|
||||||
downloaded = 1;
|
downloaded = 1;
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ main(int argc, char *argv[])
|
||||||
if(home == 0)
|
if(home == 0)
|
||||||
home = "/";
|
home = "/";
|
||||||
if(!dflag)
|
if(!dflag)
|
||||||
startup(machine, Rflag, arg, argv);
|
startup(machine, Rflag, arg, ap, argv);
|
||||||
notify(notifyf);
|
notify(notifyf);
|
||||||
getcurwd();
|
getcurwd();
|
||||||
if(argc>1){
|
if(argc>1){
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,7 @@ void settempfile(void);
|
||||||
int skipbl(void);
|
int skipbl(void);
|
||||||
void snarf(File*, Posn, Posn, Buffer*, int);
|
void snarf(File*, Posn, Posn, Buffer*, int);
|
||||||
void sortname(File*);
|
void sortname(File*);
|
||||||
void startup(char*, int, char**, char**);
|
void startup(char*, int, char**, char**, char**);
|
||||||
void state(File*, int);
|
void state(File*, int);
|
||||||
int statfd(int, ulong*, uvlong*, long*, long*, long*);
|
int statfd(int, ulong*, uvlong*, long*, long*, long*);
|
||||||
int statfile(char*, ulong*, uvlong*, long*, long*, long*);
|
int statfile(char*, ulong*, uvlong*, long*, long*, long*);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue