diff options
author | ache <ache@FreeBSD.org> | 1993-12-01 15:05:31 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1993-12-01 15:05:31 +0000 |
commit | 66add984dc368d780b1187f2890b933e174ad6f7 (patch) | |
tree | b815dac5563074c82bd86a2889fd4932c4f24ce9 /gnu/usr.bin/ld | |
parent | a88a13690abf5286a46ed53c8a0d17c7603ddb78 (diff) | |
download | FreeBSD-src-66add984dc368d780b1187f2890b933e174ad6f7.zip FreeBSD-src-66add984dc368d780b1187f2890b933e174ad6f7.tar.gz |
Remove hanging #else part (with second sbrk()) without #if & #endif
Add missing argument to findshlib, I am not shure,
but it seems that it is 1.
!!! Does anybody compile it before commit?
Diffstat (limited to 'gnu/usr.bin/ld')
-rw-r--r-- | gnu/usr.bin/ld/rtld/rtld.c | 58 |
1 files changed, 3 insertions, 55 deletions
diff --git a/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c index 2f9e361..202dfa4 100644 --- a/gnu/usr.bin/ld/rtld/rtld.c +++ b/gnu/usr.bin/ld/rtld/rtld.c @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: rtld.c,v 1.4 1993/11/22 19:05:27 jkh Exp $ + * $Id: rtld.c,v 1.5 1993/11/30 20:47:49 jkh Exp $ */ #include <machine/vmparam.h> @@ -933,7 +933,7 @@ int *usehints; if (!HINTS_VALID || !(*usehints)) { *usehints = 0; - return (char *)findshlib(name, &major, &minor); + return (char *)findshlib(name, &major, &minor, 1); } if (ld_path != NULL) { @@ -955,7 +955,7 @@ int *usehints; /* No hints available for name */ *usehints = 0; - return (char *)findshlib(name, &major, &minor); + return (char *)findshlib(name, &major, &minor, 1); } static int @@ -1075,55 +1075,3 @@ xprintf("sbrk: incr = %#x, curbrk = %#x\n", incr, curbrk); return oldbrk; } -#else - -caddr_t -sbrk(incr) -int incr; -{ - int fd = -1; - caddr_t oldbrk; - -xprintf("sbrk: incr = %#x, curbrk = %#x\n", incr, curbrk); -#if DEBUG -xprintf("sbrk: incr = %#x, curbrk = %#x\n", incr, curbrk); -#endif - if (curbrk == 0 && (curbrk = mmap(0, PAGSIZ, - PROT_READ|PROT_WRITE, - MAP_ANON|MAP_COPY, fd, 0)) == (caddr_t)-1) { - xprintf("Cannot map anonymous memory"); - _exit(1); - } - - /* There's valid memory from `curbrk' to next page boundary */ - if ((long)curbrk + incr <= (((long)curbrk + PAGSIZ) & ~(PAGSIZ - 1))) { - oldbrk = curbrk; - curbrk += incr; - return oldbrk; - } - /* - * If asking for than currently left in this chunk, - * go somewhere completely different. - */ - -#ifdef NEED_DEV_ZERO - fd = open("/dev/zero", O_RDWR, 0); - if (fd == -1) - perror("/dev/zero"); -#endif - - if ((curbrk = mmap(0, incr, - PROT_READ|PROT_WRITE, - MAP_ANON|MAP_COPY, fd, 0)) == (caddr_t)-1) { - perror("Cannot map anonymous memory"); - } - -#ifdef NEED_DEV_ZERO - close(fd); -#endif - - oldbrk = curbrk; - curbrk += incr; - - return oldbrk; -} |