From 1470b65bba482ff4626fe990dd3885063471e3ca Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 11 May 1997 09:59:05 +0000 Subject: [PATCH] use MAP_FAILED git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1705 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/ftp/ftpd/ftpd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/appl/ftp/ftpd/ftpd.c b/appl/ftp/ftpd/ftpd.c index 6aa343fca..49dd735e5 100644 --- a/appl/ftp/ftpd/ftpd.c +++ b/appl/ftp/ftpd/ftpd.c @@ -1289,13 +1289,16 @@ send_data(FILE *instr, FILE *outstr, off_t blksize) case TYPE_I: case TYPE_L: #ifdef HAVE_MMAP +#ifndef MAP_FAILED +#define MAP_FAILED (-1) +#endif { struct stat st; char *chunk; 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); - if(chunk != NULL){ + if(chunk != (void *)MAP_FAILED) { cnt = st.st_size - restart_point; auth_write(fileno(outstr), chunk + restart_point,