| 229 |
|
static void |
| 230 |
|
initrholo(void) /* get our holodeck running */ |
| 231 |
|
{ |
| 232 |
– |
extern int global_packet(); |
| 232 |
|
int i; |
| 233 |
|
/* close holodeck on exec() */ |
| 234 |
|
fcntl(hdlist[0]->fd, F_SETFD, FD_CLOEXEC); |
| 393 |
|
HDGRID *gp |
| 394 |
|
) |
| 395 |
|
{ |
| 397 |
– |
extern char *atos(); |
| 396 |
|
int i; |
| 397 |
|
int n; |
| 398 |
|
double len[3], d; |
| 456 |
|
int fd; |
| 457 |
|
FILE *fp; |
| 458 |
|
/* open & truncate file */ |
| 459 |
< |
if ((fp = fopen(hdkfile, "w+")) == NULL) { |
| 459 |
> |
if ((fp = fopen(hdkfile, "wb+")) == NULL) { |
| 460 |
|
sprintf(errmsg, "cannot open \"%s\" for writing", hdkfile); |
| 461 |
|
error(SYSTEM, errmsg); |
| 462 |
|
} |
| 464 |
|
newheader("RADIANCE", fp); |
| 465 |
|
fprintf(fp, "SOFTWARE= %s\n", VersionID); |
| 466 |
|
printvars(fp); |
| 467 |
+ |
fputendian(fp); |
| 468 |
|
fputformat(HOLOFMT, fp); |
| 469 |
|
fputc('\n', fp); |
| 470 |
|
putw(HOLOMAGIC, fp); /* put magic number */ |
| 524 |
|
off_t nextloc; |
| 525 |
|
|
| 526 |
|
if ((ncprocs > 0) & (force >= 0)) |
| 527 |
< |
fp = fopen(hdkfile, "r+"); |
| 527 |
> |
fp = fopen(hdkfile, "rb+"); |
| 528 |
|
else |
| 529 |
|
fp = NULL; |
| 530 |
|
if (fp == NULL) { |
| 531 |
< |
if ((fp = fopen(hdkfile, "r")) == NULL) { |
| 531 |
> |
if ((fp = fopen(hdkfile, "rb")) == NULL) { |
| 532 |
|
sprintf(errmsg, "cannot open \"%s\"", hdkfile); |
| 533 |
|
error(SYSTEM, errmsg); |
| 534 |
|
} |
| 630 |
|
|
| 631 |
|
|
| 632 |
|
void |
| 633 |
< |
eputs(s) /* put error message to stderr */ |
| 635 |
< |
char *s; |
| 633 |
> |
eputs(const char *s) /* put error message to stderr */ |
| 634 |
|
{ |
| 635 |
|
static int midline = 0; |
| 636 |
|
|
| 649 |
|
|
| 650 |
|
|
| 651 |
|
void |
| 652 |
< |
quit(ec) /* exit program gracefully */ |
| 655 |
< |
int ec; |
| 652 |
> |
quit(int ec) /* exit program gracefully */ |
| 653 |
|
{ |
| 654 |
|
int status = 0; |
| 655 |
|
|