Unix Technical Forum

Re: prettify the code a bit

This is a discussion on Re: prettify the code a bit within the mailing.openbsd.tech forums, part of the OpenBSD category; --> On Wed, 2 Feb 2005 06:40:53 +0059 Han Boetes <han@mijncomputer.nl> wrote: > > > - if (fd == 0) ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 07:33 AM
Jared Yanovich
 
Posts: n/a
Default Re: prettify the code a bit

On Wed, 2 Feb 2005 06:40:53 +0059
Han Boetes <han@mijncomputer.nl> wrote:

> > > - if (fd == 0)
> > > + if (fd == FILE_STDIO)

> >
> > I think you mean STDIN_FILENO. FILE_STDIO is used for something
> > else.

>
> I was following the logic of the rest of the file and 0 is used as
> FILE_STDIO:


So? 0 is the value of many constants. FILE_STDIO is used as the
way a file has been opened, not as the value for a specific file
descriptor.

> #define FILE_STDIO 0
> #define FILE_MMAP 1
> #define FILE_GZIP 2
>
> That's why I choose it. But indeed, your suggestion makes more
> sense.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:31 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com