]> git.tuebingen.mpg.de Git - paraslash.git/commit - net.c
Check for abstract sockets only once.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 Apr 2018 18:31:05 +0000 (20:31 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 12 Aug 2018 08:00:49 +0000 (10:00 +0200)
commit52cb435d3d628d27fa781b31519470eb5ef70a4a
tree7b23385ec682fe44028e3e55346a08ce2c17a050
parent2dd031d57ce69a32ccf613b947d8cfd035663d4a
Check for abstract sockets only once.

In net.c there is a static variable which is supposed to cache whether
the abstract local socket namespace is supported. This variable is
pointless because it is only ever set by command handlers, which exit
after the command completed. Hence the command handler process of
each subsequent afs command checks again. To make the caching work as
intended we must initialize the variable in the *parent* process. The
parent process, however, does not create any local sockets.

This patch changes init_unix_addr() to initialize the variable
without creating a socket when NULL is passed as the name parameter.
The server process passes NULL to initialize the static variable
while command handlers pass non NULL.
net.c
server.c