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

Function cupsdEndProcess

scheduler/process.c:390–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388 */
389
390int /* O - 0 on success, -1 on failure */
391cupsdEndProcess(int pid, /* I - Process ID */
392 int force) /* I - Force child to die */
393{
394 cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdEndProcess(pid=%d, force=%d)", pid,
395 force);
396
397 if (!pid)
398 return (0);
399
400 if (!RunUser)
401 {
402 /*
403 * When running as root, cupsd puts child processes in their own process
404 * group. Using "-pid" sends a signal to all processes in the group.
405 */
406
407 pid = -pid;
408 }
409
410 if (force)
411 return (kill(pid, SIGKILL));
412 else
413 return (kill(pid, SIGTERM));
414}
415
416
417/*

Callers 10

cupsdStopAllNotifiersFunction · 0.85
cupsd_send_notificationFunction · 0.85
cupsdCheckLogFileFunction · 0.85
cupsdCloseClientFunction · 0.85
cupsdWriteClientFunction · 0.85
stop_jobFunction · 0.85
service_checkinFunction · 0.85
cupsdStartBrowsingFunction · 0.85
dnssdClientCallbackFunction · 0.85
cupsdStartListeningFunction · 0.85

Calls 1

cupsdLogMessageFunction · 0.85

Tested by

no test coverage detected