fix for mmap and restart_point
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1666 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1286,15 +1286,17 @@ send_data(FILE *instr, FILE *outstr, off_t blksize)
|
||||
#ifdef HAVE_MMAP
|
||||
{
|
||||
struct stat st;
|
||||
void *chunk;
|
||||
char *chunk;
|
||||
int in = fileno(instr);
|
||||
if(fstat(in, &st) == 0 && S_ISREG(st.st_mode)){
|
||||
chunk = mmap(0, st.st_size, PROT_READ, MAP_SHARED, in, 0);
|
||||
if(chunk != NULL){
|
||||
auth_write(fileno(outstr), chunk, st.st_size);
|
||||
cnt = st.sz_size - restart_point;
|
||||
auth_write(fileno(outstr),
|
||||
chunk + restart_point,
|
||||
cnt);
|
||||
munmap(chunk, st.st_size);
|
||||
auth_write(fileno(outstr), NULL, 0);
|
||||
cnt = st.st_size;
|
||||
byte_count = cnt;
|
||||
transflag = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user