From kde-commits Tue May 17 21:47:56 2005 From: Allan Sandfeld Jensen Date: Tue, 17 May 2005 21:47:56 +0000 To: kde-commits Subject: Re: KDE/kdelibs/kio/kio Message-Id: <200505172347.57412.kde () carewolf ! com> X-MARC-Message: https://marc.info/?l=kde-commits&m=111636665601785 On Tuesday 17 May 2005 23:35, ralf.habacker@freenet.de wrote: > Am Dienstag, 17. Mai 2005 21:44 schrieben Sie: > > On Tuesday 17 May 2005 19:54, Ralf Habacker wrote: > > > --- trunk/KDE/kdelibs/kio/kio/kurlcompletion.cpp #415080:415081 > > > @@ -225,11 +225,17 @@ > > > // Solaris and IRIX dirent structures do not allocate space for > > > d_name. On // systems that do (HP-UX, Linux, Tru64 UNIX), we > > > overallocate space but // that's ok. > > > - > > > +#ifdef __CYGWIN__ > > > + struct dirent *dirEntry = 0; > > > + while ( !terminationRequested() && > > > + (dirEntry = ::readdir( dir))) > > > +#else > > > struct dirent *dirPosition = (struct dirent *) malloc( sizeof( > > > struct dirent ) + MAXPATHLEN + 1 ); struct dirent *dirEntry = 0; > > > while ( !terminationRequested() && > > > > > > ::readdir_r( dir, dirPosition, &dirEntry ) == 0 && dirEntry > > > :: ) > > > > > > +#endif > > > + > > > > broken. please write a configure check testing for readdir_r > > Please remember that cygwin is an unix emulation layer > http://www.cygwin.com on top of the native windows api. It does not support > readdir_r yet, so this patch is a workaround to get it running. By the time > it will be in the cygwin api and this patch could be removed. > What I think he means is that you should make a test for readdir_r in configure, and make the ifdef more generic. This way the code will still work when cygwin gets fixed, or anywhere else readdir_r is not available. `Allan