From 02990411a9fc3a59aeb01eb1ebc1c90f302cc1ad Mon Sep 17 00:00:00 2001 From: "Taylor R. Campbell" Date: Fri, 22 Jun 2007 21:25:55 +0000 Subject: [PATCH] Fix thinko in recent change: || in C yields 1 or 0, not the first non-zero value. --- v7/src/microcode/ux.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/v7/src/microcode/ux.c b/v7/src/microcode/ux.c index 126d17ee0..6e31595e5 100644 --- a/v7/src/microcode/ux.c +++ b/v7/src/microcode/ux.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: ux.c,v 1.33 2007/06/22 20:18:58 riastradh Exp $ +$Id: ux.c,v 1.34 2007/06/22 21:25:55 riastradh Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -715,9 +715,10 @@ mmap_heap_malloc_search (unsigned long request, unsigned long min_result, unsigned long max_result) { - return - ((mmap_heap_malloc_try (min_result, request, true)) - || (mmap_heap_malloc_try (min_result, request, false))); + void * addr = (mmap_heap_malloc_try (min_result, request, true)); + if (addr == 0) + addr = (mmap_heap_malloc_try (min_result, request, false)); + return addr; } #else /* defined (__linux__) */ -- 2.25.1