From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JvZuo-0007nK-U7 for mharc-grub-devel@gnu.org; Mon, 12 May 2008 11:26:14 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JvZum-0007me-U4 for grub-devel@gnu.org; Mon, 12 May 2008 11:26:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JvZuk-0007lk-8H for grub-devel@gnu.org; Mon, 12 May 2008 11:26:11 -0400 Received: from [199.232.76.173] (port=53588 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvZuk-0007lh-4j for grub-devel@gnu.org; Mon, 12 May 2008 11:26:10 -0400 Received: from aybabtu.com ([69.60.117.155]:54926) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JvZuj-0005xU-SS for grub-devel@gnu.org; Mon, 12 May 2008 11:26:10 -0400 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JvZuh-0000Xq-Dt for grub-devel@gnu.org; Mon, 12 May 2008 17:26:07 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1JvZu3-0000aa-UE for grub-devel@gnu.org; Mon, 12 May 2008 17:25:28 +0200 Date: Mon, 12 May 2008 17:25:27 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080512152527.GA1841@thorin> References: <47473879.1020004@t-online.de> <4822142F.1040505@t-online.de> <20080509124506.GA3705@thorin> <48248ABA.5010704@t-online.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <48248ABA.5010704@t-online.de> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] biosdisk, getroot for Cygwin X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 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: Mon, 12 May 2008 15:26:13 -0000 On Fri, May 09, 2008 at 07:32:42PM +0200, Christian Franke wrote: > >>+ char devpath[sizeof ("/dev/sda15") + 13]; > >> > > > >Where does this 13 come from? Would be nice to make it explicit (e.g. > >sizeof(something) or so). > > 13 "paranoia" bytes added to the required size :-) A comment saying that would be nice. On Sun, May 11, 2008 at 11:04:39PM +0200, Christian Franke wrote: > > Probably more readable and extensible - Use early returns: Yeah I like that better too. > #ifndef __CYGWIN__ > /* This might be truly slow, but is there any better way? */ > os_dev = find_root_device ("/dev", st.st_dev); > > #else /* __CYGWIN__ */ > /* Cygwin specific function. */ > os_dev = find_cygwin_root_device (dir, st.st_dev); > > #endif /* __CYGWIN__ */ I'd suggest removing the double-negation here; it looks more readable with "#ifdef / #else" IMHO (and is easier to add more OS-specific checks like "#if defined(__CYGWIN__) / #elif defined(...) / #else". -- Robert Millan I know my rights; I want my phone call! What use is a phone call… if you are unable to speak? (as seen on /.)