1 |
< |
/* Copyright (c) 1995 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1996 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
118 |
|
VIEW *getview(); |
119 |
|
char *getexp(); |
120 |
|
|
121 |
+ |
extern time_t fdate(), time(); |
122 |
|
|
123 |
+ |
|
124 |
|
main(argc, argv) |
125 |
|
int argc; |
126 |
|
char *argv[]; |
177 |
|
argv[i] = vval(NEXTANIM); /* just change input file */ |
178 |
|
if (!silent) |
179 |
|
printargs(argc, argv, stdout); |
180 |
< |
execvp(progname, argv); /* pass to next */ |
181 |
< |
quit(1); /* shouldn't return */ |
180 |
> |
if ((argv[0] = getpath(progname,getenv("PATH"),X_OK)) == NULL) |
181 |
> |
fprintf(stderr, "%s: command not found\n", progname); |
182 |
> |
else |
183 |
> |
execv(progname, argv); |
184 |
> |
quit(1); |
185 |
|
} |
186 |
|
quit(0); |
187 |
|
userr: |
192 |
|
|
193 |
|
getastat() /* check/set animation status */ |
194 |
|
{ |
195 |
< |
char buf[256]; |
195 |
> |
char sfname[256]; |
196 |
|
FILE *fp; |
197 |
|
|
198 |
< |
sprintf(buf, "%s/%s", vval(DIRECTORY), SFNAME); |
199 |
< |
if ((fp = fopen(buf, "r")) == NULL) { |
198 |
> |
sprintf(sfname, "%s/%s", vval(DIRECTORY), SFNAME); |
199 |
> |
if ((fp = fopen(sfname, "r")) == NULL) { |
200 |
|
if (errno != ENOENT) { |
201 |
< |
perror(buf); |
201 |
> |
perror(sfname); |
202 |
|
return(-1); |
203 |
|
} |
204 |
|
astat.rnext = astat.fnext = astat.tnext = 0; |
236 |
|
progname, astat.cfname); |
237 |
|
return(-1); |
238 |
|
} |
239 |
+ |
/* check control file mods. */ |
240 |
+ |
if (!nowarn && fdate(cfname) > fdate(sfname)) |
241 |
+ |
fprintf(stderr, |
242 |
+ |
"%s: warning - control file modified since last run\n", |
243 |
+ |
progname); |
244 |
|
setours: /* set our values */ |
245 |
|
strcpy(astat.host, myhostname()); |
246 |
|
astat.pid = getpid(); |
248 |
|
return(0); |
249 |
|
fmterr: |
250 |
|
fprintf(stderr, "%s: format error in status file \"%s\"\n", |
251 |
< |
progname, buf); |
251 |
> |
progname, sfname); |
252 |
|
fclose(fp); |
253 |
|
return(-1); |
254 |
|
} |