MCPcopy Create free account
hub / github.com/F-Stack/f-stack / createPidFile

Function createPidFile

app/redis-6.2.6/src/server.c:5559–5570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5557#endif /* __linux__ */
5558
5559void createPidFile(void) {
5560 /* If pidfile requested, but no pidfile defined, use
5561 * default pidfile path */
5562 if (!server.pidfile) server.pidfile = zstrdup(CONFIG_DEFAULT_PID_FILE);
5563
5564 /* Try to write the pid file in a best-effort way. */
5565 FILE *fp = fopen(server.pidfile,"w");
5566 if (fp) {
5567 fprintf(fp,"%d\n",(int)getpid());
5568 fclose(fp);
5569 }
5570}
5571
5572void daemonize(void) {
5573 int fd;

Callers 1

mainFunction · 0.85

Calls 1

zstrdupFunction · 0.85

Tested by

no test coverage detected