Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5950327
)
handle mmap() failures
author
Andrew Tridgell
<tridge@samba.org>
Wed, 6 May 1998 07:28:14 +0000
(07:28 +0000)
committer
Andrew Tridgell
<tridge@samba.org>
Wed, 6 May 1998 07:28:14 +0000
(07:28 +0000)
util.c
patch
|
blob
|
blame
|
history
diff --git
a/util.c
b/util.c
index
f1665e3
..
357b830
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-47,8
+47,12
@@
struct map_struct *map_file(int fd,OFF_T len)
ret->p_len = 0;
#ifdef HAVE_MMAP
- if (len < MAX_MAP_SIZE)
- ret->map = (char *)mmap(NULL,len,PROT_READ,MAP_SHARED,fd,0);
+ if (len < MAX_MAP_SIZE) {
+ ret->map = (char *)mmap(NULL,len,PROT_READ,MAP_SHARED,fd,0);
+ if (ret->map == (char *)-1) {
+ ret->map = NULL;
+ }
+ }
#endif
return ret;
}