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

Function cupsdStopAllNotifiers

scheduler/subscriptions.c:1197–1248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1195 */
1196
1197void
1198cupsdStopAllNotifiers(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/*

Callers 1

cupsdStopServerFunction · 0.85

Calls 7

_cupsRWLockWriteFunction · 0.85
cupsArrayFirstFunction · 0.85
cupsArrayNextFunction · 0.85
cupsdEndProcessFunction · 0.85
_cupsRWUnlockFunction · 0.85
cupsdRemoveSelectFunction · 0.85
cupsdStatBufDeleteFunction · 0.85

Tested by

no test coverage detected