sh_off_t pos; /* Position of buffer start in the file */
sh_off_t fdpos; /* Current position in the non-buffered file */
int fd; /* File descriptor, -1 if not a real file */
+ int is_temp_file; /* Is a temporary file, delete on close */
void *lldata; /* Data private to access functions below */
void *llpos; /* ... continued ... */
int (*refill)(struct fastbuf *); /* Get a buffer with new data */
bfd_close(struct fastbuf *f)
{
close(f->fd);
+ if (f->is_temp_file && unlink(f->name) < 0)
+ die("unlink(%s): %m", f->name);
}
static struct fastbuf *