use MAP_FAILED
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1705 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1289,13 +1289,16 @@ send_data(FILE *instr, FILE *outstr, off_t blksize)
|
|||||||
case TYPE_I:
|
case TYPE_I:
|
||||||
case TYPE_L:
|
case TYPE_L:
|
||||||
#ifdef HAVE_MMAP
|
#ifdef HAVE_MMAP
|
||||||
|
#ifndef MAP_FAILED
|
||||||
|
#define MAP_FAILED (-1)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
char *chunk;
|
char *chunk;
|
||||||
int in = fileno(instr);
|
int in = fileno(instr);
|
||||||
if(fstat(in, &st) == 0 && S_ISREG(st.st_mode)){
|
if(fstat(in, &st) == 0 && S_ISREG(st.st_mode)) {
|
||||||
chunk = mmap(0, st.st_size, PROT_READ, MAP_SHARED, in, 0);
|
chunk = mmap(0, st.st_size, PROT_READ, MAP_SHARED, in, 0);
|
||||||
if(chunk != NULL){
|
if(chunk != (void *)MAP_FAILED) {
|
||||||
cnt = st.st_size - restart_point;
|
cnt = st.st_size - restart_point;
|
||||||
auth_write(fileno(outstr),
|
auth_write(fileno(outstr),
|
||||||
chunk + restart_point,
|
chunk + restart_point,
|
||||||
|
|||||||
Reference in New Issue
Block a user