From owner-svn-src-head@FreeBSD.ORG Tue Dec 21 17:21:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 359CA106567A; Tue, 21 Dec 2010 17:21:42 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id C48178FC0A; Tue, 21 Dec 2010 17:21:41 +0000 (UTC) Received: by iyb26 with SMTP id 26so3407185iyb.13 for ; Tue, 21 Dec 2010 09:21:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=AhLtAIoh4RbwhDPAjp9UkxbP7fGcnRfjzifeoP9u54s=; b=eWWhYBr27ANdpnDOa4iE2NYeFuIFbip0g2BFccBT5YyY5hNFJbq7+7ch2v2QoMBiDJ R7f/G9znf5DFyjo86/1h33ZpmV7yS36+Aw30tATnrOJ5JJOuYE+XNr28cBQQWd/p+8Ql OV0c2ozgLo6ufYNl4m3UNgkN0+6SReAhsZgXE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Vphrso91H8+eFiTRj0QmCFHH/ky1w692Xg//WjLNEd5DJ1e+NWgcjMaqZnDim/vfGS n57F6DhzezrOaaKSypz0gCg6aXCkO6aHKB1hlAkLIZaO+jSVQl/MVG2FHnoxbLX9o/Yn lzFzsTXEz6tETvnjskJGubw6TfvlyQeOu1qMc= MIME-Version: 1.0 Received: by 10.231.37.1 with SMTP id v1mr5573083ibd.176.1292952100653; Tue, 21 Dec 2010 09:21:40 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.231.172.69 with HTTP; Tue, 21 Dec 2010 09:21:40 -0800 (PST) In-Reply-To: <20101221165257.GG2614@mole.fafoe.narf.at> References: <201012211629.oBLGTwh4069669@svn.freebsd.org> <20101221165257.GG2614@mole.fafoe.narf.at> Date: Tue, 21 Dec 2010 09:21:40 -0800 X-Google-Sender-Auth: h-LoR0Wh8qFs6GRenfKMAx5ADQo Message-ID: From: mdf@FreeBSD.org To: Stefan Farfeleder Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216616 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Dec 2010 17:21:42 -0000 On Tue, Dec 21, 2010 at 8:52 AM, Stefan Farfeleder wr= ote: > On Tue, Dec 21, 2010 at 04:29:58PM +0000, Matthew D Fleming wrote: >> Author: mdf >> Date: Tue Dec 21 16:29:58 2010 >> New Revision: 216616 >> URL: http://svn.freebsd.org/changeset/base/216616 >> >> Log: >> =A0 Move the fail_point_entry definition from fail.h to kern_fail.c, whi= ch >> =A0 allows putting the enumeration constants of fail point types with th= e >> =A0 text string that matches them. > > [snip] > >> +enum fail_point_t { >> + =A0 =A0 FAIL_POINT_OFF, =A0 =A0 =A0 =A0 /**< don't fail */ >> + =A0 =A0 FAIL_POINT_PANIC, =A0 =A0 =A0 /**< panic */ >> + =A0 =A0 FAIL_POINT_RETURN, =A0 =A0 =A0/**< return an errorcode */ >> + =A0 =A0 FAIL_POINT_BREAK, =A0 =A0 =A0 /**< break into the debugger */ >> + =A0 =A0 FAIL_POINT_PRINT, =A0 =A0 =A0 /**< print a message */ >> + =A0 =A0 FAIL_POINT_SLEEP, =A0 =A0 =A0 /**< sleep for some msecs */ >> + =A0 =A0 FAIL_POINT_INVALID, =A0 =A0 /**< placeholder */ >> +}; >> + >> +static const char *fail_type_strings[] =3D { >> + =A0 =A0 "off", >> + =A0 =A0 "panic", >> + =A0 =A0 "return", >> + =A0 =A0 "break", >> + =A0 =A0 "print", >> + =A0 =A0 "sleep", >> +}; > > FWIW, you can also do this in C99: > > static const char *fail_type_strings[] =3D { > =A0 =A0 =A0 =A0[FAIL_POINT_OFF] =3D "off", > }; True. In this case I also wanted to get the stuff out of the header that was really private. Thanks, matthew