Re: Unclosed files in NCPFS?

Troels Arvin (rhl@studmed.ku.dk)
Tue, 04 Nov 1997 16:11:16 +0000


Tore Olsen wrote:
> > If anyone else here has experienced a problem with ncpfs leaving files
> > open on a Novell server, please let us know. We're trying to find a
> > simple example (e.g. a command script) that shows ncpfs failing to close
> > files.
>
> Ok, I just got a new Novell server to test on. Simplest case that will
> leave an open file:
>
> int main(int argc, char** argv)
> {
> int fd;
> char buf;
> if(argc != 2) exit(1);
>
> fork();
> fd = open(argv[1], O_RDONLY);
> if(fd == -1){
> printf("can't open\n");
> exit(1);
> }
> sleep(1); /* probably just needed to "sync" the two processes (?)*/
> read(fd, &buf, 1);
> sleep(1);
> close(fd);
> }
>
> This will not always leave an open file, but often enough that I'm
> very suspicous that there is some race condition.

I'm not a programmer. So I need you to convert the above test program
into something that will compile. Then I'll test it and see if I get the
same results (I probably do).

-- 
Greetings from Troels Arvin, Copenhagen, Denmark
http://www.mdb.ku.dk/tarvin/