Commits


libthread: add threadmaybackground Programs that want to background themselves now need to define threadmaybackground returning 1. This avoids a confusing (to people and debuggers) extra parent process for all the threaded programs that will never want to background themselves.


Trivial changes: whitespace and modes. Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross <cross@gajendra.net>


9pserve: fix memory leak in warning


delete 9P2000.u thanks to Erik Quanstrom R=rsc http://codereview.appspot.com/3469042


9pserve: roll back changeset 3118 - broke ssh-agent talking to factotum


Related to issue http://bitbucket.org/rsc/plan9port/issue/38/ This patch tries to make 9pserve work again with 9P2000 clients, in case the server handled by 9pserve expects 9P2000.u. (Since changeset http://bitbucket.org/rsc/plan9port/changeset/d9843471f0bc/ servers using srv() stop communicating after they received a 9P2000 msg that has a different .u definition.) Tattach, Tauth and Tcreate 9P2000 messages will be translated now, if neccessary, to 9P2000.u by growing them to the new size, and providing the missing (default) values. The code of the first two message types has been tested with drawterm on linux (dialing factotum), and mounts from within 9vx to plan9port's factotum and dossrv. The code for Tcreate couldn't be tested due to lack of file servers both speaking 9P2000.u and allowing file creation. R=rsc_swtch, rsc CC=codebot http://codereview.appspot.com/151052


9pserve: add -c option


9pserve: add -n flag to reject auth by clients


9pserve: delete from correct hash slot (fix infinite loop)


9pserve: fix a new race involving assert(c->nmsg == 0). Just like outputthread can have processed the message but not yet called msgput, the same is true of the connoutthread, so we cannot check c->nmsg until after the connoutthread has shut down gracefully.


9pserve: fix races causing assert(c->nmsg == 0) to fail. 1. Could happen that connoutthread sends c->outq a nil just before the regular input handler sends c->outq a real message. When the connoutthread gets the nil it will free c->outq, leaving the real message unprocessed. 2. Could happen that the outputthread writes a message body to the remote 9P server and then a response comes in and then the connection gets torn down, all before the outputthread manages to call msgput(m). Thanks to David Swasey for identifying this scenario. Also change yield() loop into explicit communication. Also remove dead code involving hungup queues.


ignore window resize; should be elsewhere


use same name that srv.c does


paranoia about extension


paranoia about extension