| 204 |
|
goto fmterr; |
| 205 |
|
fclose(fp); |
| 206 |
|
if (astat.pid != 0) { /* thinks it's still running */ |
| 207 |
< |
gethostname(buf, sizeof(buf)); |
| 208 |
< |
if (strcmp(buf, astat.host)) { |
| 207 |
> |
if (strcmp(myhostname(), astat.host)) { |
| 208 |
|
fprintf(stderr, |
| 209 |
|
"%s: process %d may still be running on host %s\n", |
| 210 |
|
progname, astat.pid, astat.host); |
| 223 |
|
return(-1); |
| 224 |
|
} |
| 225 |
|
setours: /* set our values */ |
| 226 |
< |
gethostname(astat.host, sizeof(astat.host)); |
| 226 |
> |
strcpy(astat.host, myhostname()); |
| 227 |
|
astat.pid = getpid(); |
| 228 |
|
strcpy(astat.cfname, cfname); |
| 229 |
|
return(0); |