116 |
|
fputs("NCOMP=3\n", fout); /* always RGB */ |
117 |
|
if (info != NULL) /* add extra info if given */ |
118 |
|
fputs(info, fout); |
119 |
+ |
if ((outfmt == 'f') | (outfmt == 'd')) |
120 |
+ |
fputendian(fout); |
121 |
|
fputformat(formstr(outfmt), fout); |
122 |
|
fputc('\n', fout); /* empty line ends header */ |
123 |
|
} |
143 |
|
LUENT *lep; |
144 |
|
STREAMOUT *sop; |
145 |
|
char *cp; |
146 |
< |
|
146 |
> |
|
147 |
> |
info[0] = '\0'; |
148 |
|
if (ospec == NULL) { /* use stdout? */ |
149 |
|
if (!noopen & !using_stdout) { |
150 |
|
if (outfmt != 'a') |
151 |
|
SET_FILE_BINARY(stdout); |
152 |
+ |
#ifdef getc_unlocked |
153 |
+ |
flockfile(stdout); /* avoid lock/unlock overhead */ |
154 |
+ |
#endif |
155 |
|
if (header) { |
156 |
|
cp = info; |
157 |
|
if (yres > 0) { |
168 |
|
if (waitflush > 0) |
169 |
|
fflush(stdout); |
170 |
|
stdos.xr = xres; stdos.yr = yres; |
165 |
– |
#ifdef getc_unlocked |
166 |
– |
flockfile(stdout); /* avoid lock/unlock overhead */ |
167 |
– |
#endif |
171 |
|
using_stdout = 1; |
172 |
|
} |
173 |
|
stdos.ofp = stdout; |
522 |
|
off_t nbytes = *(off_t *)p; |
523 |
|
|
524 |
|
if (sop->reclen > 1) |
525 |
< |
nbytes = nbytes * sop->reclen; |
525 |
> |
nbytes *= (off_t)sop->reclen; |
526 |
|
if (fseeko(sop->ofp, nbytes, SEEK_CUR) < 0) { |
527 |
|
sprintf(errmsg, "seek error on file '%s'", e->key); |
528 |
|
error(SYSTEM, errmsg); |
591 |
|
sprintf(errmsg, "missing recover file '%s'", |
592 |
|
oname); |
593 |
|
error(WARNING, errmsg); |
594 |
+ |
lastout = 0; |
595 |
|
break; |
596 |
|
} |
597 |
|
nvals = lseek(fileno(sop->ofp), 0, SEEK_END); |
624 |
|
} |
625 |
|
if (!lastout) { /* empty output */ |
626 |
|
error(WARNING, "no previous data to recover"); |
627 |
< |
lu_done(&ofiletab); /* reclose all outputs */ |
627 |
> |
/* reclose all outputs */ |
628 |
> |
lu_doall(&ofiletab, &myclose, NULL); |
629 |
|
return; |
630 |
|
} |
631 |
|
} |