| 96 | */ |
| 97 | |
| 98 | void |
| 99 | cupsdStopServer(void) |
| 100 | { |
| 101 | if (!started) |
| 102 | return; |
| 103 | |
| 104 | /* |
| 105 | * Stop color management (as needed)... |
| 106 | */ |
| 107 | |
| 108 | cupsdStopColor(); |
| 109 | |
| 110 | /* |
| 111 | * Close all network clients... |
| 112 | */ |
| 113 | |
| 114 | cupsdCloseAllClients(); |
| 115 | cupsdStopListening(); |
| 116 | cupsdStopBrowsing(); |
| 117 | cupsdStopAllNotifiers(); |
| 118 | cupsdDeleteAllCerts(); |
| 119 | |
| 120 | if (Clients) |
| 121 | { |
| 122 | cupsArrayDelete(Clients); |
| 123 | Clients = NULL; |
| 124 | } |
| 125 | |
| 126 | /* |
| 127 | * Close the pipe for CGI processes... |
| 128 | */ |
| 129 | |
| 130 | if (CGIPipes[0] >= 0) |
| 131 | { |
| 132 | cupsdRemoveSelect(CGIPipes[0]); |
| 133 | |
| 134 | cupsdStatBufDelete(CGIStatusBuffer); |
| 135 | close(CGIPipes[1]); |
| 136 | |
| 137 | CGIPipes[0] = -1; |
| 138 | CGIPipes[1] = -1; |
| 139 | } |
| 140 | |
| 141 | /* |
| 142 | * Close all log files... |
| 143 | */ |
| 144 | |
| 145 | if (AccessFile != NULL) |
| 146 | { |
| 147 | if (AccessFile != LogStderr) |
| 148 | cupsFileClose(AccessFile); |
| 149 | |
| 150 | AccessFile = NULL; |
| 151 | } |
| 152 | |
| 153 | if (ErrorFile != NULL) |
| 154 | { |
| 155 | if (ErrorFile != LogStderr) |
no test coverage detected