Changeset View
Changeset View
Standalone View
Standalone View
stand/libsa/gzipfs.c
Show First 20 Lines • Show All 309 Lines • ▼ Show 20 Lines | zf_seek(struct open_file *f, off_t offset, int where) | ||||
return(-1); | return(-1); | ||||
/* skip forwards if required */ | /* skip forwards if required */ | ||||
while (target > zf->zf_zstream.total_out) { | while (target > zf->zf_zstream.total_out) { | ||||
errno = zf_read(f, discard, min(sizeof(discard), | errno = zf_read(f, discard, min(sizeof(discard), | ||||
target - zf->zf_zstream.total_out), NULL); | target - zf->zf_zstream.total_out), NULL); | ||||
if (errno) | if (errno) | ||||
return(-1); | return(-1); | ||||
/* Break out of loop if end of file has been reached. */ | |||||
if (zf->zf_endseen) | |||||
break; | |||||
} | } | ||||
/* This is where we are (be honest if we overshot) */ | /* This is where we are (be honest if we overshot) */ | ||||
return(zf->zf_zstream.total_out); | return(zf->zf_zstream.total_out); | ||||
} | } | ||||
static int | static int | ||||
zf_stat(struct open_file *f, struct stat *sb) | zf_stat(struct open_file *f, struct stat *sb) | ||||
Show All 12 Lines |