From bcrl@vegetable.rushton.kvack.org Mon Jun 4 17:55:37 2001 Date: Mon, 4 Jun 2001 17:27:15 -0400 From: bcrl@vegetable.rushton.kvack.org To: blah@kvack.org Subject: nbd-server --- nbd-server.c.orig Mon Jun 4 16:19:45 2001 +++ nbd-server.c Mon Jun 4 17:26:53 2001 @@ -230,6 +230,7 @@ if ((net = accept(sock, (struct sockaddr *) &addrin, &addrinlen)) < 0) err("accept: %m"); + fcntl(net, F_SETFD, 0); set_peername(net,clientname) ; if (!authorized_client(clientname)) { msg2(LOG_INFO,"Unauthorized client") ; @@ -535,6 +536,7 @@ if ((export[i/hunksize] = open(exportname3, (flags & F_READONLY) ? O_RDONLY : O_RDWR)) == -1) err("Could not open exported file: %m"); } + fcntl(export[i/hunksize], F_SETFD, 0); if (exportsize == (u64)~0) { exportsize = size_autodetect(export[0]); @@ -560,6 +562,7 @@ msg3(LOG_INFO,"About to create map and diff file %s",difffilename) ; difffile=open(difffilename,O_RDWR | O_CREAT | O_TRUNC,0600) ; if (difffile<0) err("Could not create diff file (%m)") ; + fcntl(difffile, F_SETFD, 0); if ((difmap=calloc(exportsize/DIFFPAGESIZE,sizeof(u32)))==NULL) err("Could not allocate memory") ; for (i=0;i