summaryrefslogtreecommitdiff
path: root/libpager
diff options
context:
space:
mode:
Diffstat (limited to 'libpager')
-rw-r--r--libpager/pager-memcpy.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libpager/pager-memcpy.c b/libpager/pager-memcpy.c
index f255c68d..ed63c247 100644
--- a/libpager/pager-memcpy.c
+++ b/libpager/pager-memcpy.c
@@ -1,5 +1,5 @@
/* Fault-safe copy into or out of pager-backed memory.
- Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1996,97,99,2000 Free Software Foundation, Inc.
Written by Roland McGrath.
This program is free software; you can redistribute it and/or
@@ -88,6 +88,11 @@ pager_memcpy (struct pager *pager, memory_object_t memobj,
longjmp (buf, 1);
}
+ if (to_copy == 0)
+ /* Short-circuit return if nothing to do.
+ ERR would not be initialized by the copy loop in this case. */
+ return 0;
+
if (setjmp (buf) == 0)
hurd_catch_signal (sigmask (SIGSEGV) | sigmask (SIGBUS),
window, window + windowsize,