🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #169

Bug in make-3.62 in file glob/glob.c

#169
From: Derek Ney
Date: Tue, 21 Jul 1992 14:56
25 lines
1271 bytes
I have discovered a bug in GNU make version 3.62 in
the filename globbing routine glob_in_dir(). On line
451 of file glob/glob.c, a directory is opened with
opendir(), but it is never closed. This causes make
to eat up one file descriptor each time this routine
is called. One of the most common things that calls this
is the wildcard function. Make eventually runs out of 
file descriptors if the wildcard function is called too
many times. If fixed the bug by initializing the variable
stream to NULL and then closing the stream before the
return with closedir() if stream was non-null. Following
are diffs for my fixes
diff glob.c.orig glob.c
446a447,448
>       stream = NULL;
> 
511a514,516
>       if (stream != NULL)
>               closedir(stream);
> 
519a525,528
> 
>       if (stream != NULL)
>               closedir(stream);
> 
Technical Details
Message-ID: <9207211456.AA04627@boingo.med.jhu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!boingo.med.jhu.edu!derek

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!boingo.med.jhu.edu!derek
From: derek@boingo.med.jhu.edu (Derek Ney)
Subject: Bug in make-3.62 in file glob/glob.c
Message-ID: <9207211456.AA04627@boingo.med.jhu.edu>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 21 Jul 1992 14:56:02 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 26