238 lines
182 KiB
HTML
238 lines
182 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en" dir="ltr"
|
|
xmlns:dc="http://purl.org/dc/terms/">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="generator" content="diff2html.py (http://git.droids-corp.org/gitweb/?p=diff2html)" />
|
|
<!--meta name="author" content="Fill in" /-->
|
|
<title>HTML Diff fork/daemon.cpp</title>
|
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEXAAAAAgAD///+K/HwIAAAAJUlEQVQI12NYBQQM2IgGBQ4mCIEQW7oyK4phampkGIQAc1G1AQCRxCNbyW92oQAAAABJRU5ErkJggg==" type="image/png" />
|
|
<meta property="dc:language" content="en" />
|
|
<!--meta property="dc:date" content="" /-->
|
|
<meta property="dc:modified" content="2023-07-30T17:02:05.735566+01:00" />
|
|
<meta name="description" content="File comparison" />
|
|
<meta property="dc:abstract" content="File comparison" />
|
|
<style>
|
|
table { border:0px; border-collapse:collapse; width: 100%; font-size:0.75em; font-family: Lucida Console, monospace }
|
|
td.line { color:#8080a0 }
|
|
th { background: black; color: white }
|
|
tr.diffunmodified td { background: #D0D0E0 }
|
|
tr.diffhunk td { background: #A0A0A0 }
|
|
tr.diffadded td { background: #CCFFCC }
|
|
tr.diffdeleted td { background: #FFCCCC }
|
|
tr.diffchanged td { background: #FFFFA0 }
|
|
span.diffchanged2 { background: #E0C880 }
|
|
span.diffponct { color: #B08080 }
|
|
tr.diffmisc td {}
|
|
tr.diffseparator td {}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<table class="diff">
|
|
<tr><th colspan='2'>src/​examples/​cpp03/​fork/​daemon.​cpp</th><th colspan='2'>src/​examples/​cpp11/​fork/​daemon.​cpp</th></tr>
|
|
<tr class="diffhunk"><td colspan="2">⋮</td><td colspan="2">⋮</td></tr><tr class="diffunmodified"><td class="diffline">1 </td><td class="diffpresent">/​/​</td><td class="diffline">1 </td><td class="diffpresent">/​/​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">2 </td><td class="diffpresent">/​/​<span class="diffponct">·</span>​daemon.​cpp</td><td class="diffline">2 </td><td class="diffpresent">/​/​<span class="diffponct">·</span>​daemon.​cpp</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">3 </td><td class="diffpresent">/​/​<span class="diffponct">·</span>​~~~~~~~~~~</td><td class="diffline">3 </td><td class="diffpresent">/​/​<span class="diffponct">·</span>​~~~~~~~~~~</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">4 </td><td class="diffpresent">/​/​</td><td class="diffline">4 </td><td class="diffpresent">/​/​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">5 </td><td class="diffpresent">/​/​<span class="diffponct">·</span>​Copyright<span class="diffponct">·</span>​(c)​<span class="diffponct">·</span>​2003-​2023<span class="diffponct">·</span>​Christopher<span class="diffponct">·</span>​M.​<span class="diffponct">·</span>​Kohlhoff<span class="diffponct">·</span>​(chris<span class="diffponct">·</span>​at<span class="diffponct">·</span>​kohlhoff<span class="diffponct">·</span>​dot<span class="diffponct">·</span>​com)​</td><td class="diffline">5 </td><td class="diffpresent">/​/​<span class="diffponct">·</span>​Copyright<span class="diffponct">·</span>​(c)​<span class="diffponct">·</span>​2003-​2023<span class="diffponct">·</span>​Christopher<span class="diffponct">·</span>​M.​<span class="diffponct">·</span>​Kohlhoff<span class="diffponct">·</span>​(chris<span class="diffponct">·</span>​at<span class="diffponct">·</span>​kohlhoff<span class="diffponct">·</span>​dot<span class="diffponct">·</span>​com)​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">6 </td><td class="diffpresent">/​/​</td><td class="diffline">6 </td><td class="diffpresent">/​/​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">7 </td><td class="diffpresent">/​/​<span class="diffponct">·</span>​Distributed<span class="diffponct">·</span>​under<span class="diffponct">·</span>​the<span class="diffponct">·</span>​Boost<span class="diffponct">·</span>​Software<span class="diffponct">·</span>​License,​<span class="diffponct">·</span>​Version<span class="diffponct">·</span>​1.​0.​<span class="diffponct">·</span>​(See<span class="diffponct">·</span>​accompanying</td><td class="diffline">7 </td><td class="diffpresent">/​/​<span class="diffponct">·</span>​Distributed<span class="diffponct">·</span>​under<span class="diffponct">·</span>​the<span class="diffponct">·</span>​Boost<span class="diffponct">·</span>​Software<span class="diffponct">·</span>​License,​<span class="diffponct">·</span>​Version<span class="diffponct">·</span>​1.​0.​<span class="diffponct">·</span>​(See<span class="diffponct">·</span>​accompanying</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">8 </td><td class="diffpresent">/​/​<span class="diffponct">·</span>​file<span class="diffponct">·</span>​LICENSE_1_0.​txt<span class="diffponct">·</span>​or<span class="diffponct">·</span>​copy<span class="diffponct">·</span>​at<span class="diffponct">·</span>​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​</td><td class="diffline">8 </td><td class="diffpresent">/​/​<span class="diffponct">·</span>​file<span class="diffponct">·</span>​LICENSE_1_0.​txt<span class="diffponct">·</span>​or<span class="diffponct">·</span>​copy<span class="diffponct">·</span>​at<span class="diffponct">·</span>​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">9 </td><td class="diffpresent">/​/​</td><td class="diffline">9 </td><td class="diffpresent">/​/​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">10 </td><td class="diffpresent"></td><td class="diffline">10 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">11 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<asio/​io_context.​hpp></td><td class="diffline">11 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<asio/​io_context.​hpp></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">12 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<asio/​ip/​udp.​hpp></td><td class="diffline">12 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<asio/​ip/​udp.​hpp></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">13 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<asio/​signal_set.​hpp></td><td class="diffline">13 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<asio/​signal_set.​hpp></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">14 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<<span class="diffchanged2">b</span><span class="diffchanged2">o</span><span class="diffchanged2">o</span><span class="diffchanged2">s</span><span class="diffchanged2">t</span><span class="diffchanged2">/​</span>array<span class="diffchanged2">.​</span><span class="diffchanged2">h</span><span class="diffchanged2">p</span><span class="diffchanged2">p</span>></td><td class="diffline">14 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<array></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">15 </td><td class="diffpresent"><span class="diffchanged2">#</span><span class="diffchanged2">i</span><span class="diffchanged2">n</span><span class="diffchanged2">c</span><span class="diffchanged2">l</span><span class="diffchanged2">u</span><span class="diffchanged2">d</span><span class="diffchanged2">e</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><</span><span class="diffchanged2">b</span><span class="diffchanged2">o</span><span class="diffchanged2">o</span><span class="diffchanged2">s</span><span class="diffchanged2">t</span><span class="diffchanged2">/​</span><span class="diffchanged2">b</span><span class="diffchanged2">i</span><span class="diffchanged2">n</span><span class="diffchanged2">d</span><span class="diffchanged2">/​</span><span class="diffchanged2">b</span><span class="diffchanged2">i</span><span class="diffchanged2">n</span><span class="diffchanged2">d</span><span class="diffchanged2">.​</span><span class="diffchanged2">h</span><span class="diffchanged2">p</span><span class="diffchanged2">p</span><span class="diffchanged2">></span><span class="diffchanged2"></span></td><td colspan="2"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">16 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<ctime></td><td class="diffline">15 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<ctime></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">17 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<iostream></td><td class="diffline">16 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<iostream></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">18 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<syslog.​h></td><td class="diffline">17 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<syslog.​h></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">19 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<unistd.​h></td><td class="diffline">18 </td><td class="diffpresent">#include<span class="diffponct">·</span>​<unistd.​h></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">20 </td><td class="diffpresent"></td><td class="diffline">19 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">21 </td><td class="diffpresent">using<span class="diffponct">·</span>​asio:​:​ip:​:​udp;​</td><td class="diffline">20 </td><td class="diffpresent">using<span class="diffponct">·</span>​asio:​:​ip:​:​udp;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">22 </td><td class="diffpresent"></td><td class="diffline">21 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">23 </td><td class="diffpresent">class<span class="diffponct">·</span>​udp_daytime_server</td><td class="diffline">22 </td><td class="diffpresent">class<span class="diffponct">·</span>​udp_daytime_server</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">24 </td><td class="diffpresent">{</td><td class="diffline">23 </td><td class="diffpresent">{</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">25 </td><td class="diffpresent">public:​</td><td class="diffline">24 </td><td class="diffpresent">public:​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">26 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​udp_daytime_server(as​io:​:​io_context&<span class="diffponct">·</span>​io_context)​</td><td class="diffline">25 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​udp_daytime_server(as​io:​:​io_context&<span class="diffponct">·</span>​io_context)​</td></tr>
|
|
<tr class="diffchanged"><td class="diffline">27 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​:​<span class="diffponct">·</span>​socket_(io_context,​<span class="diffponct">·</span>​<span class="diffchanged2">u</span><span class="diffchanged2">d</span><span class="diffchanged2">p</span><span class="diffchanged2">:​</span><span class="diffchanged2">:​</span><span class="diffchanged2">e</span><span class="diffchanged2">n</span><span class="diffchanged2">d</span><span class="diffchanged2">p</span><span class="diffchanged2">o</span><span class="diffchanged2">i</span><span class="diffchanged2">n</span><span class="diffchanged2">t</span><span class="diffchanged2">(</span>udp:​:​v4()​,​<span class="diffponct">·</span>​13<span class="diffchanged2">)​</span>)​</td><td class="diffline">26 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​:​<span class="diffponct">·</span>​socket_(io_context,​<span class="diffponct">·</span>​<span class="diffchanged2">{</span>udp:​:​v4()​,​<span class="diffponct">·</span>​13<span class="diffchanged2">}</span>)​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">28 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td><td class="diffline">27 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffchanged"><td class="diffline">29 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">s</span><span class="diffchanged2">t</span><span class="diffchanged2">a</span><span class="diffchanged2">r</span><span class="diffchanged2">t</span><span class="diffchanged2">_</span>receive()​;​</td><td class="diffline">28 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​receive()​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">30 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td><td class="diffline">29 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">31 </td><td class="diffpresent"></td><td class="diffline">30 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">32 </td><td class="diffpresent">private:​</td><td class="diffline">31 </td><td class="diffpresent">private:​</td></tr>
|
|
<tr class="diffchanged"><td class="diffline">33 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​void<span class="diffponct">·</span>​<span class="diffchanged2">s</span><span class="diffchanged2">t</span><span class="diffchanged2">a</span><span class="diffchanged2">r</span><span class="diffchanged2">t</span><span class="diffchanged2">_</span>receive()​</td><td class="diffline">32 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​void<span class="diffponct">·</span>​receive()​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">34 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td><td class="diffline">33 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">35 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​socket_.​async_receive_from(</td><td class="diffline">34 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​socket_.​async_receive_from(</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">36 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​asio:​:​buffer(recv_buffer_)​,​<span class="diffponct">·</span>​remote_endpoint_,​</td><td class="diffline">35 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​asio:​:​buffer(recv_buffer_)​,​<span class="diffponct">·</span>​remote_endpoint_,​</td></tr>
|
|
<tr class="diffchanged"><td class="diffline">37 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">b</span><span class="diffchanged2">o</span><span class="diffchanged2">o</span>s<span class="diffchanged2">t</span><span class="diffchanged2">:​</span><span class="diffchanged2">:​</span><span class="diffchanged2">b</span><span class="diffchanged2">i</span><span class="diffchanged2">n</span><span class="diffchanged2">d</span><span class="diffchanged2">(</span><span class="diffchanged2">&</span><span class="diffchanged2">u</span><span class="diffchanged2">d</span><span class="diffchanged2">p</span>_<span class="diffchanged2">d</span><span class="diffchanged2">a</span><span class="diffchanged2">y</span><span class="diffchanged2">t</span><span class="diffchanged2">i</span><span class="diffchanged2">m</span>e<span class="diffchanged2">_</span><span class="diffchanged2">s</span><span class="diffchanged2">e</span><span class="diffchanged2">r​</span><span class="diffchanged2">v</span><span class="diffchanged2">e</span><span class="diffchanged2">r</span>:​:​<span class="diffchanged2">h</span><span class="diffchanged2">a</span><span class="diffchanged2">n</span><span class="diffchanged2">d</span><span class="diffchanged2">l</span>e_<span class="diffchanged2">r</span><span class="diffchanged2">e</span><span class="diffchanged2">c</span><span class="diffchanged2">e</span><span class="diffchanged2">i</span><span class="diffchanged2">v</span><span class="diffchanged2">e</span><span class="diffchanged2">,​</span></td><td class="diffline">36 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">[</span><span class="diffchanged2">t</span><span class="diffchanged2">h</span><span class="diffchanged2">i</span>s<span class="diffchanged2">]</span><span class="diffchanged2">(</span><span class="diffchanged2">s</span><span class="diffchanged2">t</span><span class="diffchanged2">d</span><span class="diffchanged2">:​</span><span class="diffchanged2">:​</span><span class="diffchanged2">e</span><span class="diffchanged2">r</span><span class="diffchanged2">r</span><span class="diffchanged2">o</span><span class="diffchanged2">r</span>_<span class="diffchanged2">c</span><span class="diffchanged2">o</span><span class="diffchanged2">d</span><span class="diffchanged2">e</span><span class="diffchanged2"><span class="diffponct">·</span>​</span>e<span class="diffchanged2">c</span><span class="diffchanged2">,​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">s</span><span class="diffchanged2">t</span><span class="diffchanged2">d</span>:​:​<span class="diffchanged2">s</span><span class="diffchanged2">i</span><span class="diffchanged2">z</span>e_<span class="diffchanged2">t</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">/​</span><span class="diffchanged2">*</span><span class="diffchanged2">n</span><span class="diffchanged2">*</span><span class="diffchanged2">/​</span><span class="diffchanged2">)​</span></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">38 </td><td class="diffpresent"><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">t</span><span class="diffchanged2">h</span><span class="diffchanged2">i</span><span class="diffchanged2">s</span><span class="diffchanged2">,​</span><span class="diffponct">·</span>​<span class="diffchanged2">b</span><span class="diffchanged2">o</span><span class="diffchanged2">o</span><span class="diffchanged2">s</span><span class="diffchanged2">t</span><span class="diffchanged2">:​</span><span class="diffchanged2">:​</span><span class="diffchanged2">p</span><span class="diffchanged2">l</span><span class="diffchanged2">a</span><span class="diffchanged2">c</span><span class="diffchanged2">e</span><span class="diffchanged2">h</span><span class="diffchanged2">o</span><span class="diffchanged2">l</span><span class="diffchanged2">d</span><span class="diffchanged2">e</span><span class="diffchanged2">r</span><span class="diffchanged2">s</span><span class="diffchanged2">:​</span><span class="diffchanged2">:​</span><span class="diffchanged2">_</span><span class="diffchanged2">1</span><span class="diffchanged2">)​</span><span class="diffchanged2">)​</span><span class="diffchanged2">;​</span></td><td class="diffline">37 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">{</span></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">39 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">}</span></td><td class="diffline">38 </td><td class="diffpresent"><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffponct">·</span>​<span class="diffchanged2">i</span><span class="diffchanged2">f</span><span class="diffponct">·</span>​<span class="diffchanged2">(</span><span class="diffchanged2">!</span><span class="diffchanged2">e</span><span class="diffchanged2">c</span><span class="diffchanged2">)​</span></td></tr>
|
|
<tr class="diffadded"><td colspan="2"> </td><td class="diffline">39 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffadded"><td colspan="2"> </td><td class="diffline">40 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​using<span class="diffponct">·</span>​namespace<span class="diffponct">·</span>​std;​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​For<span class="diffponct">·</span>​time_t,​<span class="diffponct">·</span>​time<span class="diffponct">·</span>​and<span class="diffponct">·</span>​ctime;​</td></tr>
|
|
<tr class="diffadded"><td colspan="2"> </td><td class="diffline">41 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​time_t<span class="diffponct">·</span>​now<span class="diffponct">·</span>​=<span class="diffponct">·</span>​time(0)​;​</td></tr>
|
|
<tr class="diffadded"><td colspan="2"> </td><td class="diffline">42 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​std:​:​string<span class="diffponct">·</span>​message<span class="diffponct">·</span>​=<span class="diffponct">·</span>​ctime(&now)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">40 </td><td class="diffpresent"></td><td class="diffline">43 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">41 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">v</span><span class="diffchanged2">o</span><span class="diffchanged2">i</span><span class="diffchanged2">d</span><span class="diffponct">·</span>​<span class="diffchanged2">h</span><span class="diffchanged2">a</span><span class="diffchanged2">n</span><span class="diffchanged2">d</span><span class="diffchanged2">l</span><span class="diffchanged2">e</span><span class="diffchanged2">_</span><span class="diffchanged2">r</span><span class="diffchanged2">e</span><span class="diffchanged2">c</span>e<span class="diffchanged2">i</span><span class="diffchanged2">v</span><span class="diffchanged2">e</span><span class="diffchanged2">(</span>co<span class="diffchanged2">n</span><span class="diffchanged2">s</span><span class="diffchanged2">t</span><span class="diffponct">·</span>​<span class="diffchanged2">a</span><span class="diffchanged2">s</span>i<span class="diffchanged2">o</span><span class="diffchanged2">:​</span><span class="diffchanged2">:​</span><span class="diffchanged2">e</span><span class="diffchanged2">r</span><span class="diffchanged2">r</span>or<span class="diffchanged2">_</span><span class="diffchanged2">c</span><span class="diffchanged2">o</span><span class="diffchanged2">d</span>e<span class="diffchanged2">&</span><span class="diffchanged2"><span class="diffponct">·</span>​</span>ec<span class="diffchanged2">)​</span></td><td class="diffline">44 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffponct">·</span>​<span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">s</span><span class="diffchanged2">t</span><span class="diffchanged2">d</span><span class="diffchanged2">:​</span><span class="diffchanged2">:​</span>e<span class="diffchanged2">r</span><span class="diffchanged2">r</span><span class="diffchanged2">o</span><span class="diffchanged2">r</span><span class="diffchanged2">_</span>co<span class="diffchanged2">d</span><span class="diffchanged2">e</span><span class="diffponct">·</span>​i<span class="diffchanged2">g</span><span class="diffchanged2">n</span>ore<span class="diffchanged2">d</span><span class="diffchanged2">_</span>ec<span class="diffchanged2">;​</span></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">42 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">{</span></td><td class="diffline">45 </td><td class="diffpresent"><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">s</span><span class="diffchanged2">o</span><span class="diffchanged2">c</span><span class="diffchanged2">k</span><span class="diffchanged2">e</span><span class="diffchanged2">t</span><span class="diffchanged2">_</span><span class="diffchanged2">.​</span><span class="diffchanged2">s</span><span class="diffchanged2">e</span><span class="diffchanged2">n</span><span class="diffchanged2">d</span><span class="diffchanged2">_</span><span class="diffchanged2">t</span><span class="diffchanged2">o</span><span class="diffchanged2">(</span><span class="diffchanged2">a</span><span class="diffchanged2">s</span><span class="diffchanged2">i</span><span class="diffchanged2">o</span><span class="diffchanged2">:​</span><span class="diffchanged2">:​</span><span class="diffchanged2">b</span><span class="diffchanged2">u</span><span class="diffchanged2">f</span><span class="diffchanged2">f</span><span class="diffchanged2">e</span><span class="diffchanged2">r</span><span class="diffchanged2">(</span><span class="diffchanged2">m</span><span class="diffchanged2">e</span><span class="diffchanged2">s</span><span class="diffchanged2">s</span><span class="diffchanged2">a</span><span class="diffchanged2">g</span><span class="diffchanged2">e</span><span class="diffchanged2">)​</span><span class="diffchanged2">,​</span></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">43 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​i<span class="diffchanged2">f</span><span class="diffponct">·</span>​<span class="diffchanged2">(</span><span class="diffchanged2">!</span>ec)​</td><td class="diffline">46 </td><td class="diffpresent"><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">r</span><span class="diffchanged2">e</span><span class="diffchanged2">m</span><span class="diffchanged2">o</span><span class="diffchanged2">t</span><span class="diffchanged2">e</span><span class="diffchanged2">_</span><span class="diffchanged2">e</span><span class="diffchanged2">n</span><span class="diffchanged2">d</span><span class="diffchanged2">p</span><span class="diffchanged2">o</span>i<span class="diffchanged2">n</span><span class="diffchanged2">t</span><span class="diffchanged2">_</span><span class="diffchanged2">,​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">0</span><span class="diffchanged2">,​</span><span class="diffponct">·</span>​<span class="diffchanged2">i</span><span class="diffchanged2">g</span><span class="diffchanged2">n</span><span class="diffchanged2">o</span><span class="diffchanged2">r</span><span class="diffchanged2">e</span><span class="diffchanged2">d</span><span class="diffchanged2">_</span>ec)​<span class="diffchanged2">;​</span></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">44 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">{</span></td><td class="diffline">47 </td><td class="diffpresent"><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">}</span></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">45 </td><td class="diffpresent"><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">u</span><span class="diffchanged2">s</span><span class="diffchanged2">i</span><span class="diffchanged2">n</span><span class="diffchanged2">g</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">n</span><span class="diffchanged2">a</span><span class="diffchanged2">m</span><span class="diffchanged2">e</span><span class="diffchanged2">s</span><span class="diffchanged2">p</span><span class="diffchanged2">a</span><span class="diffchanged2">c</span><span class="diffchanged2">e</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">s</span><span class="diffchanged2">t</span><span class="diffchanged2">d</span><span class="diffchanged2">;​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">/​</span><span class="diffchanged2">/​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">F</span><span class="diffchanged2">o</span><span class="diffchanged2">r</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">t</span><span class="diffchanged2">i</span><span class="diffchanged2">m</span><span class="diffchanged2">e</span><span class="diffchanged2">_</span><span class="diffchanged2">t</span><span class="diffchanged2">,​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">t</span><span class="diffchanged2">i</span><span class="diffchanged2">m</span><span class="diffchanged2">e</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">a</span><span class="diffchanged2">n</span><span class="diffchanged2">d</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">c</span><span class="diffchanged2">t</span><span class="diffchanged2">i</span><span class="diffchanged2">m</span><span class="diffchanged2">e</span><span class="diffchanged2">;​</span><span class="diffchanged2"></span></td><td colspan="2"></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">46 </td><td class="diffpresent"><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">t</span><span class="diffchanged2">i</span><span class="diffchanged2">m</span><span class="diffchanged2">e</span><span class="diffchanged2">_</span><span class="diffchanged2">t</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">n</span><span class="diffchanged2">o</span><span class="diffchanged2">w</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">=</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">t</span><span class="diffchanged2">i</span><span class="diffchanged2">m</span><span class="diffchanged2">e</span><span class="diffchanged2">(</span><span class="diffchanged2">0</span><span class="diffchanged2">)​</span><span class="diffchanged2">;​</span><span class="diffchanged2"></span></td><td colspan="2"></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">47 </td><td class="diffpresent"><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">s</span><span class="diffchanged2">t</span><span class="diffchanged2">d</span><span class="diffchanged2">:​</span><span class="diffchanged2">:​</span><span class="diffchanged2">s</span><span class="diffchanged2">t</span><span class="diffchanged2">r</span><span class="diffchanged2">i</span><span class="diffchanged2">n</span><span class="diffchanged2">g</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">m</span><span class="diffchanged2">e</span><span class="diffchanged2">s</span><span class="diffchanged2">s</span><span class="diffchanged2">a</span><span class="diffchanged2">g</span><span class="diffchanged2">e</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">=</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">c</span><span class="diffchanged2">t</span><span class="diffchanged2">i</span><span class="diffchanged2">m</span><span class="diffchanged2">e</span><span class="diffchanged2">(</span><span class="diffchanged2">&</span><span class="diffchanged2">n</span><span class="diffchanged2">o</span><span class="diffchanged2">w</span><span class="diffchanged2">)​</span><span class="diffchanged2">;​</span><span class="diffchanged2"></span></td><td colspan="2"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">48 </td><td class="diffpresent"></td><td class="diffline">48 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">49 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">a</span><span class="diffchanged2">s</span><span class="diffchanged2">i</span><span class="diffchanged2">o</span><span class="diffchanged2">:​</span><span class="diffchanged2">:​</span><span class="diffchanged2">e</span><span class="diffchanged2">r</span><span class="diffchanged2">r</span><span class="diffchanged2">o</span>r<span class="diffchanged2">_</span>c<span class="diffchanged2">o</span><span class="diffchanged2">d</span>e<span class="diffchanged2"><span class="diffponct">·</span>​</span>i<span class="diffchanged2">g</span><span class="diffchanged2">n</span><span class="diffchanged2">o</span><span class="diffchanged2">r</span>e<span class="diffchanged2">d</span><span class="diffchanged2">_</span><span class="diffchanged2">e</span><span class="diffchanged2">c</span>;​</td><td class="diffline">49 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span>r<span class="diffchanged2">e</span>cei<span class="diffchanged2">v</span>e<span class="diffchanged2">(</span><span class="diffchanged2">)​</span>;​</td></tr>
|
|
<tr class="diffchanged"><td class="diffline">50 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">s</span><span class="diffchanged2">o</span><span class="diffchanged2">c</span><span class="diffchanged2">k</span><span class="diffchanged2">e</span><span class="diffchanged2">t</span><span class="diffchanged2">_</span><span class="diffchanged2">.​</span><span class="diffchanged2">s</span><span class="diffchanged2">e</span><span class="diffchanged2">n</span><span class="diffchanged2">d</span><span class="diffchanged2">_</span><span class="diffchanged2">t</span><span class="diffchanged2">o</span><span class="diffchanged2">(</span><span class="diffchanged2">a</span><span class="diffchanged2">s</span><span class="diffchanged2">i</span><span class="diffchanged2">o</span><span class="diffchanged2">:​</span><span class="diffchanged2">:​</span><span class="diffchanged2">b</span><span class="diffchanged2">u</span><span class="diffchanged2">f</span><span class="diffchanged2">f</span><span class="diffchanged2">e</span><span class="diffchanged2">r</span><span class="diffchanged2">(</span><span class="diffchanged2">m</span><span class="diffchanged2">e</span><span class="diffchanged2">s</span><span class="diffchanged2">s</span><span class="diffchanged2">a</span><span class="diffchanged2">g</span><span class="diffchanged2">e</span>)​<span class="diffchanged2">,​</span></td><td class="diffline">50 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">}</span>)​<span class="diffchanged2">;​</span></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">51 </td><td class="diffpresent"><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">r</span><span class="diffchanged2">e</span><span class="diffchanged2">m</span><span class="diffchanged2">o</span><span class="diffchanged2">t</span><span class="diffchanged2">e</span><span class="diffchanged2">_</span><span class="diffchanged2">e</span><span class="diffchanged2">n</span><span class="diffchanged2">d</span><span class="diffchanged2">p</span><span class="diffchanged2">o</span><span class="diffchanged2">i</span><span class="diffchanged2">n</span><span class="diffchanged2">t</span><span class="diffchanged2">_</span><span class="diffchanged2">,​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">0</span><span class="diffchanged2">,​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">i</span><span class="diffchanged2">g</span><span class="diffchanged2">n</span><span class="diffchanged2">o</span><span class="diffchanged2">r</span><span class="diffchanged2">e</span><span class="diffchanged2">d</span><span class="diffchanged2">_</span><span class="diffchanged2">e</span><span class="diffchanged2">c</span><span class="diffchanged2">)​</span><span class="diffchanged2">;​</span><span class="diffchanged2"></span></td><td colspan="2"></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">52 </td><td class="diffpresent"><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">}</span><span class="diffchanged2"></span></td><td colspan="2"></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">53 </td><td class="diffpresent"><span class="diffchanged2"></span></td><td colspan="2"></td></tr>
|
|
<tr class="diffchanged"><td class="diffline">54 </td><td class="diffpresent"><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">s</span><span class="diffchanged2">t</span><span class="diffchanged2">a</span><span class="diffchanged2">r</span><span class="diffchanged2">t</span><span class="diffchanged2">_</span><span class="diffchanged2">r</span><span class="diffchanged2">e</span><span class="diffchanged2">c</span><span class="diffchanged2">e</span><span class="diffchanged2">i</span><span class="diffchanged2">v</span><span class="diffchanged2">e</span><span class="diffchanged2">(</span><span class="diffchanged2">)​</span><span class="diffchanged2">;​</span><span class="diffchanged2"></span></td><td colspan="2"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">55 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td><td class="diffline">51 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">56 </td><td class="diffpresent"></td><td class="diffline">52 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">57 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​udp:​:​socket<span class="diffponct">·</span>​socket_;​</td><td class="diffline">53 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​udp:​:​socket<span class="diffponct">·</span>​socket_;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">58 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​udp:​:​endpoint<span class="diffponct">·</span>​remote_endpoint_;​</td><td class="diffline">54 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​udp:​:​endpoint<span class="diffponct">·</span>​remote_endpoint_;​</td></tr>
|
|
<tr class="diffchanged"><td class="diffline">59 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">b</span><span class="diffchanged2">o</span><span class="diffchanged2">o</span>st:​:​array<char,​<span class="diffponct">·</span>​1><span class="diffponct">·</span>​recv_buffer_;​</td><td class="diffline">55 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​st<span class="diffchanged2">d</span>:​:​array<char,​<span class="diffponct">·</span>​1><span class="diffponct">·</span>​recv_buffer_;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">60 </td><td class="diffpresent">};​</td><td class="diffline">56 </td><td class="diffpresent">};​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">61 </td><td class="diffpresent"></td><td class="diffline">57 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">62 </td><td class="diffpresent">int<span class="diffponct">·</span>​main()​</td><td class="diffline">58 </td><td class="diffpresent">int<span class="diffponct">·</span>​main()​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">63 </td><td class="diffpresent">{</td><td class="diffline">59 </td><td class="diffpresent">{</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">64 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​try</td><td class="diffline">60 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​try</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">65 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td><td class="diffline">61 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">66 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​asio:​:​io_context<span class="diffponct">·</span>​io_context;​</td><td class="diffline">62 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​asio:​:​io_context<span class="diffponct">·</span>​io_context;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">67 </td><td class="diffpresent"></td><td class="diffline">63 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">68 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Initialise<span class="diffponct">·</span>​the<span class="diffponct">·</span>​server<span class="diffponct">·</span>​before<span class="diffponct">·</span>​becoming<span class="diffponct">·</span>​a<span class="diffponct">·</span>​daemon.​<span class="diffponct">·</span>​If<span class="diffponct">·</span>​the<span class="diffponct">·</span>​process<span class="diffponct">·</span>​is</td><td class="diffline">64 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Initialise<span class="diffponct">·</span>​the<span class="diffponct">·</span>​server<span class="diffponct">·</span>​before<span class="diffponct">·</span>​becoming<span class="diffponct">·</span>​a<span class="diffponct">·</span>​daemon.​<span class="diffponct">·</span>​If<span class="diffponct">·</span>​the<span class="diffponct">·</span>​process<span class="diffponct">·</span>​is</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">69 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​started<span class="diffponct">·</span>​from<span class="diffponct">·</span>​a<span class="diffponct">·</span>​shell,​<span class="diffponct">·</span>​this<span class="diffponct">·</span>​means<span class="diffponct">·</span>​any<span class="diffponct">·</span>​errors<span class="diffponct">·</span>​will<span class="diffponct">·</span>​be<span class="diffponct">·</span>​reported<span class="diffponct">·</span>​back<span class="diffponct">·</span>​to<span class="diffponct">·</span>​the</td><td class="diffline">65 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​started<span class="diffponct">·</span>​from<span class="diffponct">·</span>​a<span class="diffponct">·</span>​shell,​<span class="diffponct">·</span>​this<span class="diffponct">·</span>​means<span class="diffponct">·</span>​any<span class="diffponct">·</span>​errors<span class="diffponct">·</span>​will<span class="diffponct">·</span>​be<span class="diffponct">·</span>​reported<span class="diffponct">·</span>​back<span class="diffponct">·</span>​to<span class="diffponct">·</span>​the</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">70 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​user.​</td><td class="diffline">66 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​user.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">71 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​udp_daytime_server<span class="diffponct">·</span>​server(io_context)​;​</td><td class="diffline">67 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​udp_daytime_server<span class="diffponct">·</span>​server(io_context)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">72 </td><td class="diffpresent"></td><td class="diffline">68 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">73 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Register<span class="diffponct">·</span>​signal<span class="diffponct">·</span>​handlers<span class="diffponct">·</span>​so<span class="diffponct">·</span>​that<span class="diffponct">·</span>​the<span class="diffponct">·</span>​daemon<span class="diffponct">·</span>​may<span class="diffponct">·</span>​be<span class="diffponct">·</span>​shut<span class="diffponct">·</span>​down.​<span class="diffponct">·</span>​You<span class="diffponct">·</span>​may</td><td class="diffline">69 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Register<span class="diffponct">·</span>​signal<span class="diffponct">·</span>​handlers<span class="diffponct">·</span>​so<span class="diffponct">·</span>​that<span class="diffponct">·</span>​the<span class="diffponct">·</span>​daemon<span class="diffponct">·</span>​may<span class="diffponct">·</span>​be<span class="diffponct">·</span>​shut<span class="diffponct">·</span>​down.​<span class="diffponct">·</span>​You<span class="diffponct">·</span>​may</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">74 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​also<span class="diffponct">·</span>​want<span class="diffponct">·</span>​to<span class="diffponct">·</span>​register<span class="diffponct">·</span>​for<span class="diffponct">·</span>​other<span class="diffponct">·</span>​signals,​<span class="diffponct">·</span>​such<span class="diffponct">·</span>​as<span class="diffponct">·</span>​SIGHUP<span class="diffponct">·</span>​to<span class="diffponct">·</span>​trigger<span class="diffponct">·</span>​a</td><td class="diffline">70 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​also<span class="diffponct">·</span>​want<span class="diffponct">·</span>​to<span class="diffponct">·</span>​register<span class="diffponct">·</span>​for<span class="diffponct">·</span>​other<span class="diffponct">·</span>​signals,​<span class="diffponct">·</span>​such<span class="diffponct">·</span>​as<span class="diffponct">·</span>​SIGHUP<span class="diffponct">·</span>​to<span class="diffponct">·</span>​trigger<span class="diffponct">·</span>​a</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">75 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​re-​read<span class="diffponct">·</span>​of<span class="diffponct">·</span>​a<span class="diffponct">·</span>​configuration<span class="diffponct">·</span>​file.​</td><td class="diffline">71 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​re-​read<span class="diffponct">·</span>​of<span class="diffponct">·</span>​a<span class="diffponct">·</span>​configuration<span class="diffponct">·</span>​file.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">76 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​asio:​:​signal_set<span class="diffponct">·</span>​signals(io_context,​<span class="diffponct">·</span>​SIGINT,​<span class="diffponct">·</span>​SIGTERM)​;​</td><td class="diffline">72 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​asio:​:​signal_set<span class="diffponct">·</span>​signals(io_context,​<span class="diffponct">·</span>​SIGINT,​<span class="diffponct">·</span>​SIGTERM)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">77 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​signals.​async_wait(</td><td class="diffline">73 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​signals.​async_wait(</td></tr>
|
|
<tr class="diffchanged"><td class="diffline">78 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">b</span><span class="diffchanged2">o</span><span class="diffchanged2">o</span>st<span class="diffchanged2">:​</span><span class="diffchanged2">:​</span><span class="diffchanged2">b</span><span class="diffchanged2">i</span><span class="diffchanged2">n</span>d<span class="diffchanged2">(</span><span class="diffchanged2">&</span><span class="diffchanged2">a</span><span class="diffchanged2">s</span><span class="diffchanged2">i</span>o<span class="diffchanged2">:​</span><span class="diffchanged2">:​</span><span class="diffchanged2">i</span><span class="diffchanged2">o</span>_co<span class="diffchanged2">n</span><span class="diffchanged2">t</span>e<span class="diffchanged2">x</span><span class="diffchanged2">t</span><span class="diffchanged2">:​</span><span class="diffchanged2">:​</span><span class="diffchanged2">s</span><span class="diffchanged2">t</span><span class="diffchanged2">o</span><span class="diffchanged2">p</span>,​<span class="diffponct">·</span>​<span class="diffchanged2">&</span><span class="diffchanged2">i</span><span class="diffchanged2">o</span><span class="diffchanged2">_</span><span class="diffchanged2">c</span><span class="diffchanged2">o</span><span class="diffchanged2">n</span><span class="diffchanged2">t</span><span class="diffchanged2">e</span><span class="diffchanged2">x</span><span class="diffchanged2">t</span><span class="diffchanged2">)​</span><span class="diffchanged2">)​</span><span class="diffchanged2">;​</span></td><td class="diffline">74 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffchanged2">[</span><span class="diffchanged2">&</span><span class="diffchanged2">]</span><span class="diffchanged2">(</span>std<span class="diffchanged2">:​</span><span class="diffchanged2">:​</span><span class="diffchanged2">e</span><span class="diffchanged2">r</span><span class="diffchanged2">r</span>o<span class="diffchanged2">r</span>_co<span class="diffchanged2">d</span>e<span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">/​</span><span class="diffchanged2">*</span><span class="diffchanged2">e</span><span class="diffchanged2">c</span><span class="diffchanged2">*</span><span class="diffchanged2">/​</span>,​<span class="diffponct">·</span>​<span class="diffchanged2">i</span><span class="diffchanged2">n</span><span class="diffchanged2">t</span><span class="diffchanged2"><span class="diffponct">·</span>​</span><span class="diffchanged2">/​</span><span class="diffchanged2">*</span><span class="diffchanged2">s</span><span class="diffchanged2">i</span><span class="diffchanged2">g</span><span class="diffchanged2">n</span><span class="diffchanged2">o</span><span class="diffchanged2">*</span><span class="diffchanged2">/​</span><span class="diffchanged2">)​</span></td></tr>
|
|
<tr class="diffadded"><td colspan="2"> </td><td class="diffline">75 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffadded"><td colspan="2"> </td><td class="diffline">76 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​io_context.​stop()​;​</td></tr>
|
|
<tr class="diffadded"><td colspan="2"> </td><td class="diffline">77 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​})​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">79 </td><td class="diffpresent"></td><td class="diffline">78 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">80 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Inform<span class="diffponct">·</span>​the<span class="diffponct">·</span>​io_context<span class="diffponct">·</span>​that<span class="diffponct">·</span>​we<span class="diffponct">·</span>​are<span class="diffponct">·</span>​about<span class="diffponct">·</span>​to<span class="diffponct">·</span>​become<span class="diffponct">·</span>​a<span class="diffponct">·</span>​daemon.​<span class="diffponct">·</span>​The</td><td class="diffline">79 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Inform<span class="diffponct">·</span>​the<span class="diffponct">·</span>​io_context<span class="diffponct">·</span>​that<span class="diffponct">·</span>​we<span class="diffponct">·</span>​are<span class="diffponct">·</span>​about<span class="diffponct">·</span>​to<span class="diffponct">·</span>​become<span class="diffponct">·</span>​a<span class="diffponct">·</span>​daemon.​<span class="diffponct">·</span>​The</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">81 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​io_context<span class="diffponct">·</span>​cleans<span class="diffponct">·</span>​up<span class="diffponct">·</span>​any<span class="diffponct">·</span>​internal<span class="diffponct">·</span>​resources,​<span class="diffponct">·</span>​such<span class="diffponct">·</span>​as<span class="diffponct">·</span>​threads,​<span class="diffponct">·</span>​that<span class="diffponct">·</span>​may</td><td class="diffline">80 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​io_context<span class="diffponct">·</span>​cleans<span class="diffponct">·</span>​up<span class="diffponct">·</span>​any<span class="diffponct">·</span>​internal<span class="diffponct">·</span>​resources,​<span class="diffponct">·</span>​such<span class="diffponct">·</span>​as<span class="diffponct">·</span>​threads,​<span class="diffponct">·</span>​that<span class="diffponct">·</span>​may</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">82 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​interfere<span class="diffponct">·</span>​with<span class="diffponct">·</span>​forking.​</td><td class="diffline">81 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​interfere<span class="diffponct">·</span>​with<span class="diffponct">·</span>​forking.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">83 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​io_context.​notify_fork(asio:​:​io_context:​:​fork_prepare)​;​</td><td class="diffline">82 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​io_context.​notify_fork(asio:​:​io_context:​:​fork_prepare)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">84 </td><td class="diffpresent"></td><td class="diffline">83 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">85 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Fork<span class="diffponct">·</span>​the<span class="diffponct">·</span>​process<span class="diffponct">·</span>​and<span class="diffponct">·</span>​have<span class="diffponct">·</span>​the<span class="diffponct">·</span>​parent<span class="diffponct">·</span>​exit.​<span class="diffponct">·</span>​If<span class="diffponct">·</span>​the<span class="diffponct">·</span>​process<span class="diffponct">·</span>​was<span class="diffponct">·</span>​started</td><td class="diffline">84 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Fork<span class="diffponct">·</span>​the<span class="diffponct">·</span>​process<span class="diffponct">·</span>​and<span class="diffponct">·</span>​have<span class="diffponct">·</span>​the<span class="diffponct">·</span>​parent<span class="diffponct">·</span>​exit.​<span class="diffponct">·</span>​If<span class="diffponct">·</span>​the<span class="diffponct">·</span>​process<span class="diffponct">·</span>​was<span class="diffponct">·</span>​started</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">86 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​from<span class="diffponct">·</span>​a<span class="diffponct">·</span>​shell,​<span class="diffponct">·</span>​this<span class="diffponct">·</span>​returns<span class="diffponct">·</span>​control<span class="diffponct">·</span>​to<span class="diffponct">·</span>​the<span class="diffponct">·</span>​user.​<span class="diffponct">·</span>​Forking<span class="diffponct">·</span>​a<span class="diffponct">·</span>​new<span class="diffponct">·</span>​process<span class="diffponct">·</span>​is</td><td class="diffline">85 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​from<span class="diffponct">·</span>​a<span class="diffponct">·</span>​shell,​<span class="diffponct">·</span>​this<span class="diffponct">·</span>​returns<span class="diffponct">·</span>​control<span class="diffponct">·</span>​to<span class="diffponct">·</span>​the<span class="diffponct">·</span>​user.​<span class="diffponct">·</span>​Forking<span class="diffponct">·</span>​a<span class="diffponct">·</span>​new<span class="diffponct">·</span>​process<span class="diffponct">·</span>​is</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">87 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​also<span class="diffponct">·</span>​a<span class="diffponct">·</span>​prerequisite<span class="diffponct">·</span>​for<span class="diffponct">·</span>​the<span class="diffponct">·</span>​subsequent<span class="diffponct">·</span>​call<span class="diffponct">·</span>​to<span class="diffponct">·</span>​setsid()​.​</td><td class="diffline">86 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​also<span class="diffponct">·</span>​a<span class="diffponct">·</span>​prerequisite<span class="diffponct">·</span>​for<span class="diffponct">·</span>​the<span class="diffponct">·</span>​subsequent<span class="diffponct">·</span>​call<span class="diffponct">·</span>​to<span class="diffponct">·</span>​setsid()​.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">88 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​if<span class="diffponct">·</span>​(pid_t<span class="diffponct">·</span>​pid<span class="diffponct">·</span>​=<span class="diffponct">·</span>​fork()​)​</td><td class="diffline">87 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​if<span class="diffponct">·</span>​(pid_t<span class="diffponct">·</span>​pid<span class="diffponct">·</span>​=<span class="diffponct">·</span>​fork()​)​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">89 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td><td class="diffline">88 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">90 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​if<span class="diffponct">·</span>​(pid<span class="diffponct">·</span>​><span class="diffponct">·</span>​0)​</td><td class="diffline">89 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​if<span class="diffponct">·</span>​(pid<span class="diffponct">·</span>​><span class="diffponct">·</span>​0)​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">91 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td><td class="diffline">90 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">92 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​We're<span class="diffponct">·</span>​in<span class="diffponct">·</span>​the<span class="diffponct">·</span>​parent<span class="diffponct">·</span>​process<span class="diffponct">·</span>​and<span class="diffponct">·</span>​need<span class="diffponct">·</span>​to<span class="diffponct">·</span>​exit.​</td><td class="diffline">91 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​We're<span class="diffponct">·</span>​in<span class="diffponct">·</span>​the<span class="diffponct">·</span>​parent<span class="diffponct">·</span>​process<span class="diffponct">·</span>​and<span class="diffponct">·</span>​need<span class="diffponct">·</span>​to<span class="diffponct">·</span>​exit.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">93 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​</td><td class="diffline">92 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">94 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​When<span class="diffponct">·</span>​the<span class="diffponct">·</span>​exit()​<span class="diffponct">·</span>​function<span class="diffponct">·</span>​is<span class="diffponct">·</span>​used,​<span class="diffponct">·</span>​the<span class="diffponct">·</span>​program<span class="diffponct">·</span>​terminates<span class="diffponct">·</span>​without</td><td class="diffline">93 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​When<span class="diffponct">·</span>​the<span class="diffponct">·</span>​exit()​<span class="diffponct">·</span>​function<span class="diffponct">·</span>​is<span class="diffponct">·</span>​used,​<span class="diffponct">·</span>​the<span class="diffponct">·</span>​program<span class="diffponct">·</span>​terminates<span class="diffponct">·</span>​without</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">95 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​invoking<span class="diffponct">·</span>​local<span class="diffponct">·</span>​variables'<span class="diffponct">·</span>​destructors.​<span class="diffponct">·</span>​Only<span class="diffponct">·</span>​global<span class="diffponct">·</span>​variables<span class="diffponct">·</span>​are</td><td class="diffline">94 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​invoking<span class="diffponct">·</span>​local<span class="diffponct">·</span>​variables'<span class="diffponct">·</span>​destructors.​<span class="diffponct">·</span>​Only<span class="diffponct">·</span>​global<span class="diffponct">·</span>​variables<span class="diffponct">·</span>​are</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">96 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​destroyed.​<span class="diffponct">·</span>​As<span class="diffponct">·</span>​the<span class="diffponct">·</span>​io_context<span class="diffponct">·</span>​object<span class="diffponct">·</span>​is<span class="diffponct">·</span>​a<span class="diffponct">·</span>​local<span class="diffponct">·</span>​variable,​<span class="diffponct">·</span>​this<span class="diffponct">·</span>​means</td><td class="diffline">95 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​destroyed.​<span class="diffponct">·</span>​As<span class="diffponct">·</span>​the<span class="diffponct">·</span>​io_context<span class="diffponct">·</span>​object<span class="diffponct">·</span>​is<span class="diffponct">·</span>​a<span class="diffponct">·</span>​local<span class="diffponct">·</span>​variable,​<span class="diffponct">·</span>​this<span class="diffponct">·</span>​means</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">97 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​we<span class="diffponct">·</span>​do<span class="diffponct">·</span>​not<span class="diffponct">·</span>​have<span class="diffponct">·</span>​to<span class="diffponct">·</span>​call:​</td><td class="diffline">96 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​we<span class="diffponct">·</span>​do<span class="diffponct">·</span>​not<span class="diffponct">·</span>​have<span class="diffponct">·</span>​to<span class="diffponct">·</span>​call:​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">98 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​</td><td class="diffline">97 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">99 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​io_context.​notify_fork(asio:​:​io_context:​:​fork_parent)​;​</td><td class="diffline">98 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​io_context.​notify_fork(asio:​:​io_context:​:​fork_parent)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">100 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​</td><td class="diffline">99 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">101 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​However,​<span class="diffponct">·</span>​this<span class="diffponct">·</span>​line<span class="diffponct">·</span>​should<span class="diffponct">·</span>​be<span class="diffponct">·</span>​added<span class="diffponct">·</span>​before<span class="diffponct">·</span>​each<span class="diffponct">·</span>​call<span class="diffponct">·</span>​to<span class="diffponct">·</span>​exit()​<span class="diffponct">·</span>​if</td><td class="diffline">100 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​However,​<span class="diffponct">·</span>​this<span class="diffponct">·</span>​line<span class="diffponct">·</span>​should<span class="diffponct">·</span>​be<span class="diffponct">·</span>​added<span class="diffponct">·</span>​before<span class="diffponct">·</span>​each<span class="diffponct">·</span>​call<span class="diffponct">·</span>​to<span class="diffponct">·</span>​exit()​<span class="diffponct">·</span>​if</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">102 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​using<span class="diffponct">·</span>​a<span class="diffponct">·</span>​global<span class="diffponct">·</span>​io_context<span class="diffponct">·</span>​object.​<span class="diffponct">·</span>​An<span class="diffponct">·</span>​additional<span class="diffponct">·</span>​call:​</td><td class="diffline">101 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​using<span class="diffponct">·</span>​a<span class="diffponct">·</span>​global<span class="diffponct">·</span>​io_context<span class="diffponct">·</span>​object.​<span class="diffponct">·</span>​An<span class="diffponct">·</span>​additional<span class="diffponct">·</span>​call:​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">103 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​</td><td class="diffline">102 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">104 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​io_context.​notify_fork(asio:​:​io_context:​:​fork_prepare)​;​</td><td class="diffline">103 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​io_context.​notify_fork(asio:​:​io_context:​:​fork_prepare)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">105 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​</td><td class="diffline">104 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">106 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​should<span class="diffponct">·</span>​also<span class="diffponct">·</span>​precede<span class="diffponct">·</span>​the<span class="diffponct">·</span>​second<span class="diffponct">·</span>​fork()​.​</td><td class="diffline">105 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​should<span class="diffponct">·</span>​also<span class="diffponct">·</span>​precede<span class="diffponct">·</span>​the<span class="diffponct">·</span>​second<span class="diffponct">·</span>​fork()​.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">107 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​exit(0)​;​</td><td class="diffline">106 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​exit(0)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">108 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td><td class="diffline">107 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">109 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​else</td><td class="diffline">108 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​else</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">110 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td><td class="diffline">109 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">111 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_ERR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"First<span class="diffponct">·</span>​fork<span class="diffponct">·</span>​failed:​<span class="diffponct">·</span>​%m")​;​</td><td class="diffline">110 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_ERR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"First<span class="diffponct">·</span>​fork<span class="diffponct">·</span>​failed:​<span class="diffponct">·</span>​%m")​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">112 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​return<span class="diffponct">·</span>​1;​</td><td class="diffline">111 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​return<span class="diffponct">·</span>​1;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">113 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td><td class="diffline">112 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">114 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td><td class="diffline">113 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">115 </td><td class="diffpresent"></td><td class="diffline">114 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">116 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Make<span class="diffponct">·</span>​the<span class="diffponct">·</span>​process<span class="diffponct">·</span>​a<span class="diffponct">·</span>​new<span class="diffponct">·</span>​session<span class="diffponct">·</span>​leader.​<span class="diffponct">·</span>​This<span class="diffponct">·</span>​detaches<span class="diffponct">·</span>​it<span class="diffponct">·</span>​from<span class="diffponct">·</span>​the</td><td class="diffline">115 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Make<span class="diffponct">·</span>​the<span class="diffponct">·</span>​process<span class="diffponct">·</span>​a<span class="diffponct">·</span>​new<span class="diffponct">·</span>​session<span class="diffponct">·</span>​leader.​<span class="diffponct">·</span>​This<span class="diffponct">·</span>​detaches<span class="diffponct">·</span>​it<span class="diffponct">·</span>​from<span class="diffponct">·</span>​the</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">117 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​terminal.​</td><td class="diffline">116 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​terminal.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">118 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​setsid()​;​</td><td class="diffline">117 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​setsid()​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">119 </td><td class="diffpresent"></td><td class="diffline">118 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">120 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​A<span class="diffponct">·</span>​process<span class="diffponct">·</span>​inherits<span class="diffponct">·</span>​its<span class="diffponct">·</span>​working<span class="diffponct">·</span>​directory<span class="diffponct">·</span>​from<span class="diffponct">·</span>​its<span class="diffponct">·</span>​parent.​<span class="diffponct">·</span>​This<span class="diffponct">·</span>​could<span class="diffponct">·</span>​be</td><td class="diffline">119 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​A<span class="diffponct">·</span>​process<span class="diffponct">·</span>​inherits<span class="diffponct">·</span>​its<span class="diffponct">·</span>​working<span class="diffponct">·</span>​directory<span class="diffponct">·</span>​from<span class="diffponct">·</span>​its<span class="diffponct">·</span>​parent.​<span class="diffponct">·</span>​This<span class="diffponct">·</span>​could<span class="diffponct">·</span>​be</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">121 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​on<span class="diffponct">·</span>​a<span class="diffponct">·</span>​mounted<span class="diffponct">·</span>​filesystem,​<span class="diffponct">·</span>​which<span class="diffponct">·</span>​means<span class="diffponct">·</span>​that<span class="diffponct">·</span>​the<span class="diffponct">·</span>​running<span class="diffponct">·</span>​daemon<span class="diffponct">·</span>​would</td><td class="diffline">120 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​on<span class="diffponct">·</span>​a<span class="diffponct">·</span>​mounted<span class="diffponct">·</span>​filesystem,​<span class="diffponct">·</span>​which<span class="diffponct">·</span>​means<span class="diffponct">·</span>​that<span class="diffponct">·</span>​the<span class="diffponct">·</span>​running<span class="diffponct">·</span>​daemon<span class="diffponct">·</span>​would</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">122 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​prevent<span class="diffponct">·</span>​this<span class="diffponct">·</span>​filesystem<span class="diffponct">·</span>​from<span class="diffponct">·</span>​being<span class="diffponct">·</span>​unmounted.​<span class="diffponct">·</span>​Changing<span class="diffponct">·</span>​to<span class="diffponct">·</span>​the<span class="diffponct">·</span>​root</td><td class="diffline">121 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​prevent<span class="diffponct">·</span>​this<span class="diffponct">·</span>​filesystem<span class="diffponct">·</span>​from<span class="diffponct">·</span>​being<span class="diffponct">·</span>​unmounted.​<span class="diffponct">·</span>​Changing<span class="diffponct">·</span>​to<span class="diffponct">·</span>​the<span class="diffponct">·</span>​root</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">123 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​directory<span class="diffponct">·</span>​avoids<span class="diffponct">·</span>​this<span class="diffponct">·</span>​problem.​</td><td class="diffline">122 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​directory<span class="diffponct">·</span>​avoids<span class="diffponct">·</span>​this<span class="diffponct">·</span>​problem.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">124 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​chdir("/​")​;​</td><td class="diffline">123 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​chdir("/​")​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">125 </td><td class="diffpresent"></td><td class="diffline">124 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">126 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​The<span class="diffponct">·</span>​file<span class="diffponct">·</span>​mode<span class="diffponct">·</span>​creation<span class="diffponct">·</span>​mask<span class="diffponct">·</span>​is<span class="diffponct">·</span>​also<span class="diffponct">·</span>​inherited<span class="diffponct">·</span>​from<span class="diffponct">·</span>​the<span class="diffponct">·</span>​parent<span class="diffponct">·</span>​process.​</td><td class="diffline">125 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​The<span class="diffponct">·</span>​file<span class="diffponct">·</span>​mode<span class="diffponct">·</span>​creation<span class="diffponct">·</span>​mask<span class="diffponct">·</span>​is<span class="diffponct">·</span>​also<span class="diffponct">·</span>​inherited<span class="diffponct">·</span>​from<span class="diffponct">·</span>​the<span class="diffponct">·</span>​parent<span class="diffponct">·</span>​process.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">127 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​We<span class="diffponct">·</span>​don't<span class="diffponct">·</span>​want<span class="diffponct">·</span>​to<span class="diffponct">·</span>​restrict<span class="diffponct">·</span>​the<span class="diffponct">·</span>​permissions<span class="diffponct">·</span>​on<span class="diffponct">·</span>​files<span class="diffponct">·</span>​created<span class="diffponct">·</span>​by<span class="diffponct">·</span>​the</td><td class="diffline">126 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​We<span class="diffponct">·</span>​don't<span class="diffponct">·</span>​want<span class="diffponct">·</span>​to<span class="diffponct">·</span>​restrict<span class="diffponct">·</span>​the<span class="diffponct">·</span>​permissions<span class="diffponct">·</span>​on<span class="diffponct">·</span>​files<span class="diffponct">·</span>​created<span class="diffponct">·</span>​by<span class="diffponct">·</span>​the</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">128 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​daemon,​<span class="diffponct">·</span>​so<span class="diffponct">·</span>​the<span class="diffponct">·</span>​mask<span class="diffponct">·</span>​is<span class="diffponct">·</span>​cleared.​</td><td class="diffline">127 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​daemon,​<span class="diffponct">·</span>​so<span class="diffponct">·</span>​the<span class="diffponct">·</span>​mask<span class="diffponct">·</span>​is<span class="diffponct">·</span>​cleared.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">129 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​umask(0)​;​</td><td class="diffline">128 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​umask(0)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">130 </td><td class="diffpresent"></td><td class="diffline">129 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">131 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​A<span class="diffponct">·</span>​second<span class="diffponct">·</span>​fork<span class="diffponct">·</span>​ensures<span class="diffponct">·</span>​the<span class="diffponct">·</span>​process<span class="diffponct">·</span>​cannot<span class="diffponct">·</span>​acquire<span class="diffponct">·</span>​a<span class="diffponct">·</span>​controlling<span class="diffponct">·</span>​terminal.​</td><td class="diffline">130 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​A<span class="diffponct">·</span>​second<span class="diffponct">·</span>​fork<span class="diffponct">·</span>​ensures<span class="diffponct">·</span>​the<span class="diffponct">·</span>​process<span class="diffponct">·</span>​cannot<span class="diffponct">·</span>​acquire<span class="diffponct">·</span>​a<span class="diffponct">·</span>​controlling<span class="diffponct">·</span>​terminal.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">132 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​if<span class="diffponct">·</span>​(pid_t<span class="diffponct">·</span>​pid<span class="diffponct">·</span>​=<span class="diffponct">·</span>​fork()​)​</td><td class="diffline">131 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​if<span class="diffponct">·</span>​(pid_t<span class="diffponct">·</span>​pid<span class="diffponct">·</span>​=<span class="diffponct">·</span>​fork()​)​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">133 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td><td class="diffline">132 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">134 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​if<span class="diffponct">·</span>​(pid<span class="diffponct">·</span>​><span class="diffponct">·</span>​0)​</td><td class="diffline">133 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​if<span class="diffponct">·</span>​(pid<span class="diffponct">·</span>​><span class="diffponct">·</span>​0)​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">135 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td><td class="diffline">134 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">136 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​exit(0)​;​</td><td class="diffline">135 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​exit(0)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">137 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td><td class="diffline">136 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">138 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​else</td><td class="diffline">137 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​else</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">139 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td><td class="diffline">138 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">140 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_ERR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"Second<span class="diffponct">·</span>​fork<span class="diffponct">·</span>​failed:​<span class="diffponct">·</span>​%m")​;​</td><td class="diffline">139 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_ERR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"Second<span class="diffponct">·</span>​fork<span class="diffponct">·</span>​failed:​<span class="diffponct">·</span>​%m")​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">141 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​return<span class="diffponct">·</span>​1;​</td><td class="diffline">140 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​return<span class="diffponct">·</span>​1;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">142 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td><td class="diffline">141 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">143 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td><td class="diffline">142 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">144 </td><td class="diffpresent"></td><td class="diffline">143 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">145 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Close<span class="diffponct">·</span>​the<span class="diffponct">·</span>​standard<span class="diffponct">·</span>​streams.​<span class="diffponct">·</span>​This<span class="diffponct">·</span>​decouples<span class="diffponct">·</span>​the<span class="diffponct">·</span>​daemon<span class="diffponct">·</span>​from<span class="diffponct">·</span>​the<span class="diffponct">·</span>​terminal</td><td class="diffline">144 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Close<span class="diffponct">·</span>​the<span class="diffponct">·</span>​standard<span class="diffponct">·</span>​streams.​<span class="diffponct">·</span>​This<span class="diffponct">·</span>​decouples<span class="diffponct">·</span>​the<span class="diffponct">·</span>​daemon<span class="diffponct">·</span>​from<span class="diffponct">·</span>​the<span class="diffponct">·</span>​terminal</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">146 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​that<span class="diffponct">·</span>​started<span class="diffponct">·</span>​it.​</td><td class="diffline">145 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​that<span class="diffponct">·</span>​started<span class="diffponct">·</span>​it.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">147 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​close(0)​;​</td><td class="diffline">146 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​close(0)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">148 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​close(1)​;​</td><td class="diffline">147 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​close(1)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">149 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​close(2)​;​</td><td class="diffline">148 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​close(2)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">150 </td><td class="diffpresent"></td><td class="diffline">149 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">151 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​We<span class="diffponct">·</span>​don't<span class="diffponct">·</span>​want<span class="diffponct">·</span>​the<span class="diffponct">·</span>​daemon<span class="diffponct">·</span>​to<span class="diffponct">·</span>​have<span class="diffponct">·</span>​any<span class="diffponct">·</span>​standard<span class="diffponct">·</span>​input.​</td><td class="diffline">150 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​We<span class="diffponct">·</span>​don't<span class="diffponct">·</span>​want<span class="diffponct">·</span>​the<span class="diffponct">·</span>​daemon<span class="diffponct">·</span>​to<span class="diffponct">·</span>​have<span class="diffponct">·</span>​any<span class="diffponct">·</span>​standard<span class="diffponct">·</span>​input.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">152 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​if<span class="diffponct">·</span>​(open("/​dev/​null",​<span class="diffponct">·</span>​O_RDONLY)​<span class="diffponct">·</span>​<<span class="diffponct">·</span>​0)​</td><td class="diffline">151 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​if<span class="diffponct">·</span>​(open("/​dev/​null",​<span class="diffponct">·</span>​O_RDONLY)​<span class="diffponct">·</span>​<<span class="diffponct">·</span>​0)​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">153 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td><td class="diffline">152 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">154 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_ERR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"Unable<span class="diffponct">·</span>​to<span class="diffponct">·</span>​open<span class="diffponct">·</span>​/​dev/​null:​<span class="diffponct">·</span>​%m")​;​</td><td class="diffline">153 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_ERR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"Unable<span class="diffponct">·</span>​to<span class="diffponct">·</span>​open<span class="diffponct">·</span>​/​dev/​null:​<span class="diffponct">·</span>​%m")​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">155 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​return<span class="diffponct">·</span>​1;​</td><td class="diffline">154 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​return<span class="diffponct">·</span>​1;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">156 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td><td class="diffline">155 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">157 </td><td class="diffpresent"></td><td class="diffline">156 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">158 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Send<span class="diffponct">·</span>​standard<span class="diffponct">·</span>​output<span class="diffponct">·</span>​to<span class="diffponct">·</span>​a<span class="diffponct">·</span>​log<span class="diffponct">·</span>​file.​</td><td class="diffline">157 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Send<span class="diffponct">·</span>​standard<span class="diffponct">·</span>​output<span class="diffponct">·</span>​to<span class="diffponct">·</span>​a<span class="diffponct">·</span>​log<span class="diffponct">·</span>​file.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">159 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​const<span class="diffponct">·</span>​char*<span class="diffponct">·</span>​output<span class="diffponct">·</span>​=<span class="diffponct">·</span>​"/​tmp/​asio.​daemon.​out";​</td><td class="diffline">158 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​const<span class="diffponct">·</span>​char*<span class="diffponct">·</span>​output<span class="diffponct">·</span>​=<span class="diffponct">·</span>​"/​tmp/​asio.​daemon.​out";​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">160 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​const<span class="diffponct">·</span>​int<span class="diffponct">·</span>​flags<span class="diffponct">·</span>​=<span class="diffponct">·</span>​O_WRONLY<span class="diffponct">·</span>​|<span class="diffponct">·</span>​O_CREAT<span class="diffponct">·</span>​|<span class="diffponct">·</span>​O_APPEND;​</td><td class="diffline">159 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​const<span class="diffponct">·</span>​int<span class="diffponct">·</span>​flags<span class="diffponct">·</span>​=<span class="diffponct">·</span>​O_WRONLY<span class="diffponct">·</span>​|<span class="diffponct">·</span>​O_CREAT<span class="diffponct">·</span>​|<span class="diffponct">·</span>​O_APPEND;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">161 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​const<span class="diffponct">·</span>​mode_t<span class="diffponct">·</span>​mode<span class="diffponct">·</span>​=<span class="diffponct">·</span>​S_IRUSR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​S_IWUSR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​S_IRGRP<span class="diffponct">·</span>​|<span class="diffponct">·</span>​S_IROTH;​</td><td class="diffline">160 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​const<span class="diffponct">·</span>​mode_t<span class="diffponct">·</span>​mode<span class="diffponct">·</span>​=<span class="diffponct">·</span>​S_IRUSR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​S_IWUSR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​S_IRGRP<span class="diffponct">·</span>​|<span class="diffponct">·</span>​S_IROTH;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">162 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​if<span class="diffponct">·</span>​(open(output,​<span class="diffponct">·</span>​flags,​<span class="diffponct">·</span>​mode)​<span class="diffponct">·</span>​<<span class="diffponct">·</span>​0)​</td><td class="diffline">161 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​if<span class="diffponct">·</span>​(open(output,​<span class="diffponct">·</span>​flags,​<span class="diffponct">·</span>​mode)​<span class="diffponct">·</span>​<<span class="diffponct">·</span>​0)​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">163 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td><td class="diffline">162 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">164 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_ERR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"Unable<span class="diffponct">·</span>​to<span class="diffponct">·</span>​open<span class="diffponct">·</span>​output<span class="diffponct">·</span>​file<span class="diffponct">·</span>​%s:​<span class="diffponct">·</span>​%m",​<span class="diffponct">·</span>​output)​;​</td><td class="diffline">163 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_ERR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"Unable<span class="diffponct">·</span>​to<span class="diffponct">·</span>​open<span class="diffponct">·</span>​output<span class="diffponct">·</span>​file<span class="diffponct">·</span>​%s:​<span class="diffponct">·</span>​%m",​<span class="diffponct">·</span>​output)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">165 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​return<span class="diffponct">·</span>​1;​</td><td class="diffline">164 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​return<span class="diffponct">·</span>​1;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">166 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td><td class="diffline">165 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">167 </td><td class="diffpresent"></td><td class="diffline">166 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">168 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Also<span class="diffponct">·</span>​send<span class="diffponct">·</span>​standard<span class="diffponct">·</span>​error<span class="diffponct">·</span>​to<span class="diffponct">·</span>​the<span class="diffponct">·</span>​same<span class="diffponct">·</span>​log<span class="diffponct">·</span>​file.​</td><td class="diffline">167 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Also<span class="diffponct">·</span>​send<span class="diffponct">·</span>​standard<span class="diffponct">·</span>​error<span class="diffponct">·</span>​to<span class="diffponct">·</span>​the<span class="diffponct">·</span>​same<span class="diffponct">·</span>​log<span class="diffponct">·</span>​file.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">169 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​if<span class="diffponct">·</span>​(dup(1)​<span class="diffponct">·</span>​<<span class="diffponct">·</span>​0)​</td><td class="diffline">168 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​if<span class="diffponct">·</span>​(dup(1)​<span class="diffponct">·</span>​<<span class="diffponct">·</span>​0)​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">170 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td><td class="diffline">169 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">171 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_ERR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"Unable<span class="diffponct">·</span>​to<span class="diffponct">·</span>​dup<span class="diffponct">·</span>​output<span class="diffponct">·</span>​descriptor:​<span class="diffponct">·</span>​%m")​;​</td><td class="diffline">170 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_ERR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"Unable<span class="diffponct">·</span>​to<span class="diffponct">·</span>​dup<span class="diffponct">·</span>​output<span class="diffponct">·</span>​descriptor:​<span class="diffponct">·</span>​%m")​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">172 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​return<span class="diffponct">·</span>​1;​</td><td class="diffline">171 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​return<span class="diffponct">·</span>​1;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">173 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td><td class="diffline">172 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">174 </td><td class="diffpresent"></td><td class="diffline">173 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">175 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Inform<span class="diffponct">·</span>​the<span class="diffponct">·</span>​io_context<span class="diffponct">·</span>​that<span class="diffponct">·</span>​we<span class="diffponct">·</span>​have<span class="diffponct">·</span>​finished<span class="diffponct">·</span>​becoming<span class="diffponct">·</span>​a<span class="diffponct">·</span>​daemon.​<span class="diffponct">·</span>​The</td><td class="diffline">174 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​Inform<span class="diffponct">·</span>​the<span class="diffponct">·</span>​io_context<span class="diffponct">·</span>​that<span class="diffponct">·</span>​we<span class="diffponct">·</span>​have<span class="diffponct">·</span>​finished<span class="diffponct">·</span>​becoming<span class="diffponct">·</span>​a<span class="diffponct">·</span>​daemon.​<span class="diffponct">·</span>​The</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">176 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​io_context<span class="diffponct">·</span>​uses<span class="diffponct">·</span>​this<span class="diffponct">·</span>​opportunity<span class="diffponct">·</span>​to<span class="diffponct">·</span>​create<span class="diffponct">·</span>​any<span class="diffponct">·</span>​internal<span class="diffponct">·</span>​file<span class="diffponct">·</span>​descriptors</td><td class="diffline">175 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​io_context<span class="diffponct">·</span>​uses<span class="diffponct">·</span>​this<span class="diffponct">·</span>​opportunity<span class="diffponct">·</span>​to<span class="diffponct">·</span>​create<span class="diffponct">·</span>​any<span class="diffponct">·</span>​internal<span class="diffponct">·</span>​file<span class="diffponct">·</span>​descriptors</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">177 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​that<span class="diffponct">·</span>​need<span class="diffponct">·</span>​to<span class="diffponct">·</span>​be<span class="diffponct">·</span>​private<span class="diffponct">·</span>​to<span class="diffponct">·</span>​the<span class="diffponct">·</span>​new<span class="diffponct">·</span>​process.​</td><td class="diffline">176 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​that<span class="diffponct">·</span>​need<span class="diffponct">·</span>​to<span class="diffponct">·</span>​be<span class="diffponct">·</span>​private<span class="diffponct">·</span>​to<span class="diffponct">·</span>​the<span class="diffponct">·</span>​new<span class="diffponct">·</span>​process.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">178 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​io_context.​notify_fork(asio:​:​io_context:​:​fork_child)​;​</td><td class="diffline">177 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​io_context.​notify_fork(asio:​:​io_context:​:​fork_child)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">179 </td><td class="diffpresent"></td><td class="diffline">178 </td><td class="diffpresent"></td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">180 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​The<span class="diffponct">·</span>​io_context<span class="diffponct">·</span>​can<span class="diffponct">·</span>​now<span class="diffponct">·</span>​be<span class="diffponct">·</span>​used<span class="diffponct">·</span>​normally.​</td><td class="diffline">179 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​/​/​<span class="diffponct">·</span>​The<span class="diffponct">·</span>​io_context<span class="diffponct">·</span>​can<span class="diffponct">·</span>​now<span class="diffponct">·</span>​be<span class="diffponct">·</span>​used<span class="diffponct">·</span>​normally.​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">181 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_INFO<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"Daemon<span class="diffponct">·</span>​started")​;​</td><td class="diffline">180 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_INFO<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"Daemon<span class="diffponct">·</span>​started")​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">182 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​io_context.​run()​;​</td><td class="diffline">181 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​io_context.​run()​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">183 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_INFO<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"Daemon<span class="diffponct">·</span>​stopped")​;​</td><td class="diffline">182 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_INFO<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"Daemon<span class="diffponct">·</span>​stopped")​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">184 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td><td class="diffline">183 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">185 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​catch<span class="diffponct">·</span>​(std:​:​exception&<span class="diffponct">·</span>​e)​</td><td class="diffline">184 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​catch<span class="diffponct">·</span>​(std:​:​exception&<span class="diffponct">·</span>​e)​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">186 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td><td class="diffline">185 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​{</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">187 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_ERR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"Exception:​<span class="diffponct">·</span>​%s",​<span class="diffponct">·</span>​e.​what()​)​;​</td><td class="diffline">186 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​syslog(LOG_ERR<span class="diffponct">·</span>​|<span class="diffponct">·</span>​LOG_USER,​<span class="diffponct">·</span>​"Exception:​<span class="diffponct">·</span>​%s",​<span class="diffponct">·</span>​e.​what()​)​;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">188 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​std:​:​cerr<span class="diffponct">·</span>​<<<span class="diffponct">·</span>​"Exception:​<span class="diffponct">·</span>​"<span class="diffponct">·</span>​<<<span class="diffponct">·</span>​e.​what()​<span class="diffponct">·</span>​<<<span class="diffponct">·</span>​std:​:​endl;​</td><td class="diffline">187 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​<span class="diffponct">·</span>​std:​:​cerr<span class="diffponct">·</span>​<<<span class="diffponct">·</span>​"Exception:​<span class="diffponct">·</span>​"<span class="diffponct">·</span>​<<<span class="diffponct">·</span>​e.​what()​<span class="diffponct">·</span>​<<<span class="diffponct">·</span>​std:​:​endl;​</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">189 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td><td class="diffline">188 </td><td class="diffpresent"><span class="diffponct">·</span>​<span class="diffponct">·</span>​}</td></tr>
|
|
<tr class="diffunmodified"><td class="diffline">190 </td><td class="diffpresent">}</td><td class="diffline">189 </td><td class="diffpresent">}</td></tr>
|
|
|
|
</table>
|
|
|
|
<footer>
|
|
<p>Modified at 30.07.2023. HTML formatting created by <a href="http://git.droids-corp.org/gitweb/?p=diff2html;a=summary">diff2html</a>. </p>
|
|
</footer>
|
|
</body></html>
|