File: sendrequestor.cc

package info (click to toggle)
stealth 3.00.00-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,380 kB
  • ctags: 371
  • sloc: cpp: 2,730; makefile: 161; sh: 98
file content (19 lines) | stat: -rw-r--r-- 471 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "ipc.ih"

void IPC::sendRequestor(string const &msg)
{
    if (d_requestorPid == 0)
    {
        m2 << "no requestor PID. Would have sent `" << msg << '\'' << endl;
        return;
    }

    write(msg);

    if (kill(d_requestorPid, SIGUSR1) == 0)
        m2 << "to pid " << d_requestorPid << ": " << msg << endl;
    else
        m2 << "could not signal requestor " << d_requestorPid << 
                                        " (" << msg << ')' << endl;

}