delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/12/01/12:35:45

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3C0914A1.662F7F8F@phekda.freeserve.co.uk>
Date: Sat, 01 Dec 2001 17:34:25 +0000
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Re: st_blksize patch, revision 4
References: <3C08FA41 DOT B9181F10 AT phekda DOT freeserve DOT co DOT uk> <2945-Sat01Dec2001183513+0200-eliz AT is DOT elta DOT co DOT il>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Eli Zaretskii wrote:
> Why did you need to include string.h in fd_props.h?

To get a definition for NULL.

> Richard Dawe wrote:
> >   #ifndef  NO_ST_BLKSIZE
> > !   if (__get_fd_name(fhandle))
> > !     {
> > !       const char *filename;
> > !       char fixed_filename[PATH_MAX + 1];
> > !
> > !       filename = __get_fd_name(fhandle);
> > !       _fixpath(filename, fixed_filename);
> 
> This will bomb if __get_fd_name returns NULL.  I think you should
> recover gracefully in that case, probably return the transfer buffer
> size or something.  Or maybe fail the whole thing, if you must, just
> don't crash.

The 'if (true)' part is conditional on __get_fd_name() returning non-zero,
so filename will never be NULL. Maybe I should explicitly check that it's
non-NULL, rather than assuming NULL == 0:

    if (__get_fd_name(fhandle) != NULL)
      {
         ...
      }

I've just noticed _STAT_* are defined in fstat.c & lstat.c too, so I'll
remove those. There are some combinations of stat flags, e.g.
_STAT_EXECBIT, that are used in *stat.c. Shall I move these to sys/stat.h
and document in __djstat_flags texinfo docs?

Thanks, bye, Rich =]

-- 
Richard Dawe
http://www.phekda.freeserve.co.uk/richdawe/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019