[PATCH 19/21] [terminal] guard open and close against repeated calls

Scott James Remnant scott at ubuntu.com
Thu Mar 18 13:00:08 PDT 2010


On Thu, 2010-03-18 at 15:08 -0400, Ray Strode wrote:

> On Thu, Mar 18, 2010 at 1:06 AM, Scott James Remnant <scott at ubuntu.com> wrote:
> > Since we have a status flag whether or not the terminal fd is open,
> > use it in the open and close functions to guard against repeated
> > calls.
> 
> Should these be assertions?
> 
I thought about that; but one advantage of just making them guards is
that then the renderers and plugins don't have to care.

They can just call ply_terminal_open() on the terminal, without first
checking the is_open -- which makes it much more "I need this terminal
open, open it if it isn't" -- and I kinda like that.

Scott
-- 
Scott James Remnant
scott at ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/plymouth/attachments/20100318/9bfbd232/attachment.pgp>


More information about the plymouth mailing list