X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f X-Recipient: djgpp-workers AT delorie DOT com X-Authenticated: #27081556 X-Provags-ID: V01U2FsdGVkX19ILF9HDEhILEjb0wicdcvHDLRyQg2Bd9Bi58EtuA WhT3X9f5D8nIiC From: Juan Manuel Guerrero To: djgpp-workers AT delorie DOT com Subject: Re: Return value of endmntent() Date: Sat, 17 Sep 2011 03:27:29 +0200 User-Agent: KMail/1.9.10 References: <201109170250 DOT 11147 DOT juan DOT guerrero AT gmx DOT de> <201109170103 DOT p8H13cvv003743 AT envy DOT delorie DOT com> In-Reply-To: <201109170103.p8H13cvv003743@envy.delorie.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201109170327.29704.juan.guerrero@gmx.de> X-Y-GMX-Trusted: 0 Reply-To: djgpp-workers AT delorie DOT com Am Samstag, 17. September 2011 schrieb DJ Delorie: > > I don't think it matters what it returns, since it's called *after* > all the processing is done. > > So, returning 1 is fine. > OK, the issue that confused me was that the function reurned a pointer instead of an integer and then a 0 instead of a 1 as told in the documentation. If it does not relly matter then I commit the original patch propossed by Ozkan Sezer. Regards, Juan M. Guerrero Index: djgpp/src/libc/compat/mntent/mntent.c =================================================================== RCS file: /cvs/djgpp/djgpp/src/libc/compat/mntent/mntent.c,v retrieving revision 1.11 diff -U 5 -r1.11 mntent.c --- djgpp/src/libc/compat/mntent/mntent.c 2 Aug 2009 05:37:01 -0000 1.11 +++ djgpp/src/libc/compat/mntent/mntent.c 17 Sep 2011 01:16:05 -0000 @@ -869,11 +869,11 @@ endmntent(FILE *filep) { if (filep != (FILE *)1) { errno = EBADF; /* fake errno for invalid handle */ - return NULL; + return 0; } drive_number = 0; skip_drive_b = 0; return 1; }