libPW.a(curdir.o) [SVR3.0+]

L. Mark Larsen lml at cbnews.ATT.COM
Thu Mar 30 04:36:32 AEST 1989


With SVR3.0, libPW.a(curdir.o) uses a new algorithm that doesn't chdir().
Unfortunately, a small bug was introduced which causes each invocation
of curdir() to leave open an extra file descriptor.  If you use something
like build, which calls curdir() twice and usually is fork'd several
levels deep, you quickly run out of file descriptors for the real work.
For those with source, the solution is to add a call to closedir() just
before the return when identical() returns true:
	if( identical( &cdirectory, sbp ) ) {
 		closedir( cdp );	/* missing call in original source */
		stradd( str, "/" );
		return  str;
	}

For those without source, you could always use a pre-SVR3.0 version with
the old algorithm - it worked fine.

L. Mark Larsen
att!atlas!lml
lml at atlas.ATT.COM



More information about the Comp.bugs.sys5 mailing list