From: Lucio De Re <lucio@proxima.alt.za>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] opendir/closedir in CVS sources
Date: Tue, 8 Jan 2002 19:45:26 +0200 [thread overview]
Message-ID: <20020108194526.D12098@cackle.proxima.alt.za> (raw)
In-Reply-To: <20020108185830.C12098@cackle.proxima.alt.za>; from Lucio De Re on Tue, Jan 08, 2002 at 06:58:31PM +0200
[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]
On Tue, Jan 08, 2002 at 06:58:31PM +0200, Lucio De Re wrote:
>
> I see things like:
>
> Opened dir '.' as 5
> N test/mkfile
> succeeded to close dir 5
> 8.out import: Importing /n/other/sys/cvs/test/9
> Opened dir '.' as 6
> N /test/9/mkfile
> succeeded to close dir 6
> 8.out import: Importing /n/other/sys/cvs/test/9/boot
> Opened dir '.' as 7
> ...
>
> from my debugging output. One consideration is that these are freshly
> created directories, presumably following a mkdir/chdir operation.
>
I seem unable to reproduce the problem from a simple test program :-(
I attach the diffs for my test code in /sys/src/cmd/cvs/src/import.c.
If CVS exists as 8.out, the following commands should exhibit the
behaviour above:
% CVSROOT=$home/cvsroot
% mkdir $CVSROOT
% 8.out init
% cd /sys/src
% .../8.out import -mTest test ABC DEF
At this point, one can crash 8.out and remove the spurious
directories before filling up the repository.
++L
> I _do_ run out of FDs around 100.
>
> ++L
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 706 bytes --]
23,41d22
< #define TESTING
< #ifdef TESTING
< #undef CVS_OPEN
< #undef CVS_OPENDIR
<
< int CVS_OPEN (const char *path, int flags, mode_t *mode)
< {
< int fd = open (path, flags, mode);
< fprintf (stderr, "Opened '%s' as %d\n", path, fd);
< return fd;
< }
< DIR *CVS_OPENDIR (const char *path)
< {
< DIR *dirp = opendir (path);
< fprintf (stderr, "Opened dir '%s' as %d\n", path, dirp->dd_fd);
< return dirp;
< }
< #endif
<
508,514d488
< #ifdef TESTING
< if (closedir (dirp) != 0) {
< fprintf (stderr, "failed to close dir %d - err %d\n", dirp->dd_fd, errno);
< } else {
< fprintf (stderr, "succeeded to close dir %d\n", dirp->dd_fd);
< }
< #else
516d489
< #endif
next prev parent reply other threads:[~2002-01-08 17:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-08 16:47 rob pike
2002-01-08 16:58 ` Lucio De Re
2002-01-08 17:45 ` Lucio De Re [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-01-08 16:40 Lucio De Re
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020108194526.D12098@cackle.proxima.alt.za \
--to=lucio@proxima.alt.za \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).