MCPcopy Create free account
hub / github.com/git/git / serve_cache

Function serve_cache

builtin/credential-cache--daemon.c:231–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231static void serve_cache(const char *socket_path, int debug)
232{
233 struct unix_stream_listen_opts opts = UNIX_STREAM_LISTEN_OPTS_INIT;
234 int fd;
235
236 fd = unix_stream_listen(socket_path, &opts);
237 if (fd < 0)
238 die_errno("unable to bind to '%s'", socket_path);
239
240 printf("ok\n");
241 fclose(stdout);
242 if (!debug) {
243 if (!freopen("/dev/null", "w", stderr))
244 die_errno("unable to point stderr to /dev/null");
245 }
246
247 while (serve_cache_loop(fd))
248 ; /* nothing */
249
250 close(fd);
251}
252
253static const char permissions_advice[] = N_(
254"The permissions on your socket directory are too loose; other\n"

Callers 1

Calls 3

unix_stream_listenFunction · 0.85
die_errnoFunction · 0.85
serve_cache_loopFunction · 0.85

Tested by

no test coverage detected