Received: from list by monty-python.gnu.org with archive (Exim 4.30) id 1B4dpI-0008QQ-H2 for mharc-grub-devel@gnu.org; Sat, 20 Mar 2004 05:35:36 -0500 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B4dpG-0008PV-78 for grub-devel@gnu.org; Sat, 20 Mar 2004 05:35:34 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B4dok-0008JN-DN for grub-devel@gnu.org; Sat, 20 Mar 2004 05:35:33 -0500 Received: from [62.21.238.74] (helo=pc-jeroen) by monty-python.gnu.org with esmtp (TLSv1:RC4-SHA:128) (Exim 4.30) id 1B4djV-0007Xl-BH for grub-devel@gnu.org; Sat, 20 Mar 2004 05:29:37 -0500 Received: from jeroen by pc-jeroen with local (Exim 4.30) id 1B4djN-0000Oz-HC for grub-devel@gnu.org; Sat, 20 Mar 2004 11:29:29 +0100 Date: Sat, 20 Mar 2004 11:29:29 +0100 To: The development of GRUB 2 Message-ID: <20040320102929.GA1525@dekkers.cx> References: <40595AA3.6000800@ciam.ru> <200403181331.51694.okuji@enbug.org> <405B64FB.4020109@ciam.ru> <87ish0cy4z.fsf@marco.marco-g.com> <405B6C8E.8070108@ciam.ru> <87ad2ccwaf.fsf@marco.marco-g.com> <405B812C.7080301@ciam.ru> <87wu5gbddz.fsf@marco.marco-g.com> <405B942B.4000001@ciam.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <405B942B.4000001@ciam.ru> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Jeroen Dekkers Subject: Re: GRUB2: *BSD and more patch X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Mar 2004 10:35:34 -0000 On Sat, Mar 20, 2004 at 03:45:31AM +0300, Sergey Matveychuk wrote: > +#endif > + > + close (fd); > + } > + > + pupa_util_info ("the size of %s is %lu", name, disk->total_sectors); > + > + return PUPA_ERR_NONE; > > fail: You removed the fail: label from the __linux__ code, please add it back. > @@ -659,11 +711,12 @@ get_os_disk (const char *os_dev) > > return path; > > -#elif defined(__GNU__) > +#elif defined(__GNU__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) > path = xstrdup (os_dev); > - if (strncmp ("/dev/sd", path, 7) == 0 || strncmp ("/dev/hd", path, 7) == 0) > + if (strncmp ("/dev/sd", path, 7) == 0 || strncmp ("/dev/hd", path, 7) == 0 > + || strncmp ("/dev/ad", path, 7) == 0 || strncmp ("/dev/wd", path, 7) == 0) This is not correct. GNU doesn't use /dev/ad and /dev/wd. You should do the check for /dev/ad and /dev/wd only when !__GNU__. > @@ -194,7 +197,11 @@ pupa_memalign (pupa_size_t align, pupa_s > { > void *p; > > +#ifdef HAVE_MEMALIGN > p = memalign (align, size); > +#else > + p = malloc(size); > +#endif > if (! p) > pupa_util_error ("out of memory"); I think it's better to just use pupa_util_error ("memalign not available") instead of malloc(). pupa_memalign() isn't used now, so it's not really a big problem, but when it is used, the memory must be aligned. If the memory isn't aligned when it needs to be that can cause subtle and hard to debug bugs. It is better to fail loudly. -- Jeroen Dekkers