| 1195 | */ |
| 1196 | |
| 1197 | void |
| 1198 | cupsdStopAllNotifiers(void) |
| 1199 | { |
| 1200 | cupsd_subscription_t *sub; /* Current subscription */ |
| 1201 | |
| 1202 | |
| 1203 | /* |
| 1204 | * See if we have started any notifiers... |
| 1205 | */ |
| 1206 | |
| 1207 | if (!NotifierStatusBuffer) |
| 1208 | return; |
| 1209 | |
| 1210 | /* |
| 1211 | * Yes, kill any processes that are left... |
| 1212 | */ |
| 1213 | |
| 1214 | _cupsRWLockWrite(&SubscriptionsLock); |
| 1215 | |
| 1216 | for (sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions); |
| 1217 | sub; |
| 1218 | sub = (cupsd_subscription_t *)cupsArrayNext(Subscriptions)) |
| 1219 | { |
| 1220 | if (sub->pid) |
| 1221 | { |
| 1222 | cupsdEndProcess(sub->pid, 0); |
| 1223 | |
| 1224 | close(sub->pipe); |
| 1225 | sub->pipe = -1; |
| 1226 | } |
| 1227 | } |
| 1228 | |
| 1229 | _cupsRWUnlock(&SubscriptionsLock); |
| 1230 | |
| 1231 | /* |
| 1232 | * Close the status pipes... |
| 1233 | */ |
| 1234 | |
| 1235 | if (NotifierPipes[0] >= 0) |
| 1236 | { |
| 1237 | cupsdRemoveSelect(NotifierPipes[0]); |
| 1238 | |
| 1239 | cupsdStatBufDelete(NotifierStatusBuffer); |
| 1240 | |
| 1241 | close(NotifierPipes[0]); |
| 1242 | close(NotifierPipes[1]); |
| 1243 | |
| 1244 | NotifierPipes[0] = -1; |
| 1245 | NotifierPipes[1] = -1; |
| 1246 | NotifierStatusBuffer = NULL; |
| 1247 | } |
| 1248 | } |
| 1249 | |
| 1250 | |
| 1251 | /* |
no test coverage detected