MCPcopy Create free account
hub / github.com/OpenPrinting/cups / cupsdStartServer

Function cupsdStartServer

scheduler/server.c:34–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32 */
33
34void
35cupsdStartServer(void)
36{
37 /*
38 * Create the default security profile...
39 */
40
41 DefaultProfile = cupsdCreateProfile(0, 1);
42
43#ifdef HAVE_SANDBOX_H
44 if (!DefaultProfile && UseSandboxing && Sandboxing != CUPSD_SANDBOXING_OFF)
45 {
46 /*
47 * Failure to create the sandbox profile means something really bad has
48 * happened and we need to shutdown immediately.
49 */
50
51 return;
52 }
53#endif /* HAVE_SANDBOX_H */
54
55 /*
56 * Start color management (as needed)...
57 */
58
59 cupsdStartColor();
60
61 /*
62 * Startup all the networking stuff...
63 */
64
65 cupsdStartListening();
66 cupsdStartBrowsing();
67
68 /*
69 * Create a pipe for CGI processes...
70 */
71
72 if (cupsdOpenPipe(CGIPipes))
73 cupsdLogMessage(CUPSD_LOG_ERROR,
74 "cupsdStartServer: Unable to create pipes for CGI status!");
75 else
76 {
77 CGIStatusBuffer = cupsdStatBufNew(CGIPipes[0], "[CGI]");
78
79 cupsdAddSelect(CGIPipes[0], (cupsd_selfunc_t)cupsdUpdateCGI, NULL, NULL);
80 }
81
82 /*
83 * Mark that the server has started and printers and jobs may be changed...
84 */
85
86 LastEvent = CUPSD_EVENT_PRINTER_CHANGED | CUPSD_EVENT_JOB_STATE_CHANGED |
87 CUPSD_EVENT_SERVER_STARTED;
88 started = 1;
89
90 cupsdSetBusyState(0);
91}

Callers 1

mainFunction · 0.85

Calls 9

cupsdCreateProfileFunction · 0.85
cupsdStartColorFunction · 0.85
cupsdStartListeningFunction · 0.85
cupsdStartBrowsingFunction · 0.85
cupsdOpenPipeFunction · 0.85
cupsdLogMessageFunction · 0.85
cupsdStatBufNewFunction · 0.85
cupsdAddSelectFunction · 0.85
cupsdSetBusyStateFunction · 0.85

Tested by

no test coverage detected