delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/12/04/20:46:49

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_RG,TW_SW
X-Spam-Check-By: sourceware.org
Message-ID: <4EDC224D.3020907@gmail.com>
Date: Sun, 04 Dec 2011 17:45:49 -0800
From: Daniel Colascione <dan DOT colascione AT gmail DOT com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: injob version 1.3
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------enig77974F43BAEA62474A7EAD45
Content-Type: multipart/mixed;
 boundary="------------090306080502090103040904"

This is a multi-part message in MIME format.
--------------090306080502090103040904
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

/**
 * injob: runs a program (Win32 or Cygwin) in a job object, imbuing it
 * and all its sub-processes with Cygwin job control support.
 *
 * Revision history:
 *
 * Version 1.3 - 2011-12-04
 *
 *   - Add ability to wait for all processes in a job to exit
 *     before killing the entire job.
 *
 *   - Add ability to trace execution of processes in jobs.
 *
 *   - Correctly block SIGHUP.
 *
 *   - Print PIDs of children in the job when SIGUSR1 is
 *     received.
 *
 *   - Correctly propagate exit status of Cygwin programs in the job.
 *
 * Version 1.0 - 2011-04-06
 *
 *   - Initial release
 *
 */


--------------090306080502090103040904
Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
 name="injob.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="injob.c"

LyoqCiAqIGluam9iOiBydW5zIGEgcHJvZ3JhbSAoV2luMzIgb3IgQ3lnd2lu
KSBpbiBhIGpvYiBvYmplY3QsIGltYnVpbmcgaXQKICogYW5kIGFsbCBpdHMg
c3ViLXByb2Nlc3NlcyB3aXRoIEN5Z3dpbiBqb2IgY29udHJvbCBzdXBwb3J0
LgogKgogKiBSZXZpc2lvbiBoaXN0b3J5OgogKgogKiBWZXJzaW9uIDEuMyAt
IDIwMTEtMTItMDQKICoKICogICAtIEFkZCBhYmlsaXR5IHRvIHdhaXQgZm9y
IGFsbCBwcm9jZXNzZXMgaW4gYSBqb2IgdG8gZXhpdAogKiAgICAgYmVmb3Jl
IGtpbGxpbmcgdGhlIGVudGlyZSBqb2IuCiAqCiAqICAgLSBBZGQgYWJpbGl0
eSB0byB0cmFjZSBleGVjdXRpb24gb2YgcHJvY2Vzc2VzIGluIGpvYnMuCiAq
CiAqICAgLSBDb3JyZWN0bHkgYmxvY2sgU0lHSFVQLgogKgogKiAgIC0gUHJp
bnQgUElEcyBvZiBjaGlsZHJlbiBpbiB0aGUgam9iIHdoZW4gU0lHVVNSMiBp
cwogKiAgICAgcmVjZWl2ZWQuCiAqCiAqICAgLSBDb3JyZWN0bHkgcHJvcGFn
YXRlIGV4aXQgc3RhdHVzIG9mIEN5Z3dpbiBwcm9ncmFtcyBpbiB0aGUgam9i
LgogKgogKiBWZXJzaW9uIDEuMCAtIDIwMTEtMDQtMDYKICoKICogICAtIElu
aXRpYWwgcmVsZWFzZQogKgogKi8KCiNkZWZpbmUgX1dJTjMyX1dJTk5UIDB4
MDUwMCAvKldpbjJrKi8KI2RlZmluZSBTVFJJQ1QKI2RlZmluZSBVTklDT0RF
IDEKI2RlZmluZSBfVU5JQ09ER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gaXMgYmxvY2tlZCBvbiBwaXBlLgogKgogKiAgIC0g
UGFyZW50IGNyZWF0ZXMgam9iIG9iamVjdCBhbmQgcHV0cyB0aGUgY2hpbGQK
ICogICAgIGludG8gaXQgKGNoaWxkIGlzIHN0aWxsIGJsb2NrZWQpLgogKgog
KiAgIC0gUGFyZW50IGdpdmVzIGFsbC1jbGVhciBzaWduYWwgdG8gY2hpbGQg
Ynkgd3JpdGluZyBvbmUgYnl0ZSB0bwogKiAgICAgUF9XIGFuZCBjbG9zaW5n
IGl0LgogKgogKiAgIC0gUGFyZW50IHdhaXRzIGZvciBTSUdJTlQsIFNJR1RF
Uk0sIFNJR0NITEQsIGV0Yy4KICoKICovCgpzdGF0aWMgQk9PTCBXSU5BUEkK
KCpYSXNQcm9jZXNzSW5Kb2IpKAogICAgSEFORExFIFByb2Nlc3NIYW5kbGUs
CiAgICBIQU5ETEUgSm9iSGFuZGxlLAogICAgUEJPT0wgUmVzdWx0CiAgICAp
OwoKI2RlZmluZSBDSEsob3ApICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICBcCiAgICAoeyAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgIGludCBjaGtf
cmV0OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICBcCiAgICAgICAgZG8geyAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICBjaGtfcmV0ID0g
KG9wKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICB9
IHdoaWxlIChjaGtfcmV0ID09IC0xICYmIGVycm5vID09IEVJTlRSKTsgICAg
ICBcCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgXAogICAgICAgIGlmIChjaGtfcmV0ID09IC0xKSB7
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgZnBy
aW50ZiAoc3RkZXJyLCBQUkdOQU1FICI6ICIgI29wICI6ICVzXG4iLCBcCiAg
ICAgICAgICAgICAgICAgICAgIHN0cmVycm9yIChlcnJubykpOyAgICAgICAg
ICAgICAgICAgXAogICAgICAgICAgICBnb3RvIG91dDsgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICB9ICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgICAg
Y2hrX3JldDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgXAogICAgfSkKCiNkZWZpbmUgQ0hLX1czMl9IQU5ETEUob3ApICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgKHsgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAg
ICBIQU5ETEUgY2hrX3JldCA9IChvcCk7ICAgICAgICAgICAgICAgICAgICAg
ICAgICBcCiAgICAgICAgaWYgKGNoa19yZXQgPT0gTlVMTCB8fCAgICAgICAg
ICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICBjaGtfcmV0ID09IElO
VkFMSURfSEFORExFX1ZBTFVFKSAgICAgICAgICAgIFwKICAgICAgICB7ICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBc
CiAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgUFJHTkFNRSAiOiAiICNv
cCAiOiAlc1xuIiwgXAogICAgICAgICAgICAgICAgICAgICBlcnJtc2cgKEdl
dExhc3RFcnJvciAoKSkpOyAgICAgICAgIFwKICAgICAgICAgICAgZ290byBv
dXQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAg
ICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgXAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIFwKICAgICAgICBjaGtfcmV0OyAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICB9KQoKI2Rl
ZmluZSBDSEtfVzMyX0JPT0wob3ApICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICBcCiAgICAoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgIEJPT0wgY2hrX3JldCA9
IChvcCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICBp
ZiAoY2hrX3JldCA9PSBGQUxTRSkgeyAgICAgICAgICAgICAgICAgICAgICAg
ICBcCiAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgUFJHTkFNRSAiOiAi
ICNvcCAiOiAlc1xuIiwgXAogICAgICAgICAgICAgICAgICAgICBlcnJtc2cg
KEdldExhc3RFcnJvciAoKSkpOyAgICAgICAgIFwKICAgICAgICAgICAgZ290
byBvdXQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAg
ICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgXAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICBjaGtfcmV0OyAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICB9KQoK
CiNkZWZpbmUgUElQRV9SRUFEICAwCiNkZWZpbmUgUElQRV9XUklURSAxCgpz
dHJ1Y3Qgc3VzcGVuZAp7CiAgICBEV09SRCAgIHRocmVhZF9pZDsKICAgIEhB
TkRMRSAgdGhyZWFkOwoKICAgIFNMSVNUX0VOVFJZIChzdXNwZW5kKSBlbnRy
aWVzOwp9OwoKc3RhdGljIHZ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wogICAgICAgIH0K
CiAgICAgICAgbWVtc2V0ICgmdGhlbnQsIDAsIHNpemVvZiAodGhlbnQpKTsK
ICAgICAgICB0aGVudC5kd1NpemUgPSBzaXplb2YgKHRoZW50KTsKCiAgICAg
ICAgaWYgKFRocmVhZDMyRmlyc3QgKHNuYXAsICZ0aGVudCkgPT0gRkFMU0Up
IHsKICAgICAgICAgICAgZ290byBuZXh0X3NuYXBzaG90OwogICAgICAgIH0K
CiAgICAgICAgZG8gewogICAgICAgICAgICAvKiBUaHJlYWQzMntGaXJzdCxO
ZXh0fSBpcyBhbGxvd2VkIHRvIHJldHVybiBhIHN0cnVjdAogICAgICAgICAg
ICAgICBzbWFsbGVyIHRoYXQgdGhlIG9uZSB3ZSBhc2tlZCBmb3IsIHNvIG1h
a2Ugc3VyZSB0aGUKICAgICAgICAgICAgICAgZmllbGRzIHdlIHVzZWQgYXJl
IGluY2x1ZGVkIGluIHRoaXMgc3RydWN0dXJlLiAqLwogICAgICAgICAgICBp
ZiAodGhlbnQuZHdTaXplIDwgc2l6ZW9mIChEV09SRCkqNCkgewogICAgICAg
ICAgICAgICAgZ290byBuZXh0X3RocmVhZDsKICAgICAgICAgICAgfQoKICAg
ICAgICAgICAgcHJvYyA9IE5VTEw7CiAgICAgICAgICAgIHRocmVhZCA9IE5V
TEw7CgogICAgICAgICAgICBwcm9jID0gT3BlblByb2Nlc3MgKG9wZW5fcHJv
Y2Vzc19zY2FuX2ZsYWdzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIEZBTFNFIC8qZG8gbm90IGluaGVyaXQqLywKICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICB0aGVudC50aDMyT3duZXJQcm9jZXNzSUQpOwoK
ICAgICAgICAgICAgaWYgKHByb2MgPT0gTlVMTCkgewogICAgICAgICAgICAg
ICAgZ290byBuZXh0X3RocmVhZDsKICAgICAgICAgICAgfQoKICAgICAgICAg
ICAgaWYgKFhJc1Byb2Nlc3NJbkpvYiAocHJvYywgam9iLCAmcHJvY2Vzc19p
bl9qb2IpID09IEZBTFNFKSB7CiAgICAgICAgICAgICAgICBnb3RvIG5leHRf
dGhyZWFkOwogICAgICAgICAgICB9CgogICAgICAgICAgICBpZiAocHJvY2Vz
c19pbl9qb2IgPT0gRkFMU0UpIHsKICAgICAgICAgICAgICAgIGdvdG8gbmV4
dF90aHJlYWQ7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC8qIFdlIGZv
dW5kIGEgdGhyZWFkIGluIGEgcHJvY2VzcyB0aGF0J3MgaW4gb3VyIGpvYi4g
IE5vdwogICAgICAgICAgICAgKiB0aGlzIHBhcnQgaXMgTyhOXjIpOiB3ZSBl
eGFtaW5lIG91ciBlbnRpcmUgbGlzdAogICAgICAgICAgICAgKiBzbyBmYXIg
dG8gbWFrZSBzdXJlIHdlIGhhdmVuJ3QgYWxyZWFkeSBub3RpY2VkIHRoaXMK
ICAgICAgICAgICAgICogdGhyZWFkLiAqLwoKICAgICAgICAgICAgaWYgKGlz
X3RocmVhZF9hbHJlYWR5X3N1c3BlbmRlZCAodGhlbnQudGgzMlRocmVhZElE
KSkgewogICAgICAgICAgICAgICAgZ290byBuZXh0X3RocmVhZDsKICAgICAg
ICAgICAgfQoKICAgICAgICAgICAgdGhyZWFkID0gT3BlblRocmVhZCAoVEhS
RUFEX1NVU1BFTkRfUkVTVU1FLAogICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICBGQUxTRSAvKmRvIG5vdCBpbmhlcml0Ki8sCiAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIHRoZW50LnRoMzJUaHJlYWRJRCk7Cgog
ICAgICAgICAgICBpZiAodGhyZWFkID09IE5VTEwpIHsKICAgICAgICAgICAg
ICAgIGdvdG8gbmV4dF90aHJlYWQ7CiAgICAgICAgICAgIH0KCiAgICAgICAg
ICAgIC8qIFdlIGZvdW5kIGEgbWF0Y2ggd2UgZGlkbid0IG5vdGljZSBiZWZv
cmUuICovCgogICAgICAgICAgICBuZXdfc3VzcCA9IG1hbGxvYyAoc2l6ZW9m
ICgqbmV3X3N1c3ApKTsKICAgICAgICAgICAgaWYgKG5ld19zdXNwID09IE5V
TEwpIHsKICAgICAgICAgICAgICAgIGdvdG8gbmV4dF90aHJlYWQ7CiAgICAg
ICAgICAgIH0KCiAgICAgICAgICAgIG5ld19zdXNwLT50aHJlYWQgPSB0aHJl
YWQ7CiAgICAgICAgICAgIG5ld19zdXNwLT50aHJlYWRfaWQgPSB0aGVudC50
aDMyVGhyZWFkSUQ7CgogICAgICAgICAgICAvKiBUcnkgdG8gc3VzcGVuZCB0
aGUgdGhyZWFkICovCgogICAgICAgICAgICBpZiAoU3VzcGVuZFRocmVhZCAo
dGhyZWFkKSA9PSAoRFdPUkQpLTEpIHsKICAgICAgICAgICAgICAgIGdvdG8g
bmV4dF90aHJlYWQ7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIFNMSVNU
X0lOU0VSVF9IRUFEICgmc3VzcGVuZF9saXN0X2hlYWQsIG5ld19zdXNwLCBl
bnRyaWVzKTsKICAgICAgICAgICAgKytucl9zdXNwZW5kZWQ7CgogICAgICAg
ICAgICB0aHJlYWQgPSBOVUxMOwogICAgICAgICAgICBuZXdfc3VzcCA9IE5V
TEw7CgogICAgICAgICAgICBuZXh0X3RocmVhZDoKCiAgICAgICAgICAgIGZy
ZWUgKG5ld19zdXNwKTsKCiAgICAgICAgICAgIGlmICh0aHJlYWQgIT0gTlVM
TCkgewogICAgICAgICAgICAgICAgQ2xvc2VIYW5kbGUgKHRocmVhZCk7CiAg
ICAgICAgICAgIH0KCiAgICAgICAgICAgIGlmIChwcm9jICE9IE5VTEwpIHsK
ICAgICAgICAgICAgICAgIENsb3NlSGFuZGxlIChwcm9jKTsKICAgICAgICAg
ICAgfQoKICAgICAgICAgICAgbWVtc2V0ICgmdGhlbnQsIDAsIHNpemVvZiAo
dGhlbnQpKTsKICAgICAgICAgICAgdGhlbnQuZHdTaXplID0gc2l6ZW9mIC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vbmUgd2UgYXNrZWQgZm9yLCBzbyBtYWtlIHN1cmUgdGhlCiAg
ICAgICAgICAgZmllbGRzIHdlIHVzZWQgYXJlIGluY2x1ZGVkIGluIHRoaXMg
c3RydWN0dXJlLiAqLwogICAgICAgIGlmIChwcm9jZW50LmR3U2l6ZSA8IHNp
emVvZiAoRFdPUkQpKjQpIHsKICAgICAgICAgICAgZ290byBuZXh0X3Byb2Nl
c3M7CiAgICAgICAgfQoKICAgICAgICBwcm9jID0gT3BlblByb2Nlc3MgKG9w
ZW5fcHJvY2Vzc19zY2FuX2ZsYWdzLAogICAgICAgICAgICAgICAgICAgICAg
ICAgICAgRkFMU0UgLypkbyBub3QgaW5oZXJpdCovLAogICAgICAgICAgICAg
ICAgICAgICAgICAgICAgcHJvY2VudC50aDMyUHJvY2Vzc0lEKTsKCiAgICAg
ICAgaWYgKHByb2MgPT0gTlVMTCkgewogICAgICAgICAgICBnb3RvIG5leHRf
cHJvY2VzczsKICAgICAgICB9CgogICAgICAgIGlmIChYSXNQcm9jZXNzSW5K
b2IgKHByb2MsIGpvYiwgJnByb2Nlc3NfaW5fam9iKSA9PSBGQUxTRSkgewog
ICAgICAgICAgICBnb3RvIG5leHRfcHJvY2VzczsKICAgICAgICB9CgogICAg
ICAgIGlmIChwcm9jZXNzX2luX2pvYiA9PSBGQUxTRSkgewogICAgICAgICAg
ICBnb3RvIG5leHRfcHJvY2VzczsKICAgICAgICB9CgogICAgICAgIGZwcmlu
dGYgKHN0ZGVyciwgIiAgJXVcbiIsICh1bnNpZ25lZClwcm9jZW50LnRoMzJQ
cm9jZXNzSUQpOwogICAgICAgICsrcHJvY2luam9iOwoKICAgICAgbmV4dF9w
cm9jZXNzOgoKICAgICAgICBpZiAocHJvYyAhPSBOVUxMKSB7CiAgICAgICAg
ICAgIENsb3NlSGFuZGxlIChwcm9jKTsKICAgICAgICB9CgogICAgICAgIG1l
bXNldCAoJnByb2NlbnQsIDAsIHNpemVvZiAocHJvY2VudCkpOwogICAg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dGRlcnIsIFBSR05BTUUgIjogY291bGQgbm90IHNwYXduIFwiJXNcIjogJXNc
biIsCiAgICAgICAgICAgICBhcmd2WzBdLCBzdHJlcnJvciAoZXJybm8pKTsK
ICAgIHJldCA9IDEyODsKCiAgICBvdXQ6CiAgICByZXR1cm4gcmV0Owp9Cgpz
dGF0aWMgSEFORExFIGNvbXBsZXRpb25fcG9ydDsKc3RhdGljIHB0aHJlYWRf
dCBtYWluX3RocmVhZDsKc3RhdGljIGludCB2ZXJib3NlX21vbiA9IDA7Cgov
LyBDb3BpZWQgZnJvbSBNU0ROIGFuZCByZW5hbWVkIHRvIGF2b2lkIGNvbmZs
aWN0IHdpdGggZnV0dXJlIEN5Z3dpbgovLyBfUEVCIGRlZmluaXRpb24uCnR5
cGVkZWYgc3RydWN0IF9YUEVCIHsKICBCWVRFICAgICAgICAgICAgICAgICAg
ICAgICAgICBSZXNlcnZlZDFbMl07CiAgQllURSAgICAgICAgICAgICAgICAg
ICAgICAgICAgQmVpbmdEZWJ1Z2dlZDsKICBCWVRFICAgICAgICAgICAgICAg
ICAgICAgICAgICBSZXNlcnZlZDJbMV07CiAgUFZPSUQgICAgICAgICAgICAg
ICAgICAgICAgICAgUmVzZXJ2ZWQzWzJdOwogIFBWT0lEICAgICAgICAgICAg
ICAgICAgICAgICAgIExkcjsKICBQUlRMX1VTRVJfUFJPQ0VTU19QQVJBTUVU
RVJTICBQcm9jZXNzUGFyYW1ldGVyczsKICBCWVRFICAgICAgICAgICAgICAg
ICAgICAgICAgICBSZXNlcnZlZDRbMTA0XTsKICBQVk9JRCAgICAgICAgICAg
ICAgICAgICAgICAgICBSZXNlcnZlZDVbNTJdOwogIFBWT0lEICAgICAgICAg
ICAgICAgICAgICAgICAgIFBvc3RQcm9jZXNzSW5pdFJvdXRpbmU7CiAgQllU
RSAgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ2WzEyOF07CiAg
UFZPSUQgICAgICAgICAgICAgICAgICAgICAgICAgUm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AgICAgICAgUHJvY2Vzc0Jhc2ljSW5mb3JtYXRpb24sCiAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICZiYXNpY2luZm8sCiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAoYmFzaWNpbmZv
KSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCk7
CiAgICBpZiAoIU5UX1NVQ0NFU1MgKG50KSkgewogICAgICAgIHN3cHJpbnRm
IChidWYsIF9jb3VudG9mIChidWYpLAogICAgICAgICAgICAgICAgICBMIltb
TnRRdWVyeUluZm9ybWF0aW9uUHJvY2VzcyBGQUlMRUQ6ICV1XV0iLAogICAg
ICAgICAgICAgICAgICAodW5zaWduZWQpIG50KTsKICAgICAgICBjbWRsaW5l
ID0gd2NzZHVwIChidWYpOwogICAgICAgIGdvdG8gb3V0OwogICAgfQoKICAg
IGlmICghUmVhZFByb2Nlc3NNZW1vcnkgKAogICAgICAgICAgICBwcm9jZXNz
LAogICAgICAgICAgICAmKCgoUFhQRUIpKGJhc2ljaW5mby5QZWJCYXNlQWRk
cmVzcykpLT5Qcm9jZXNzUGFyYW1ldGVycyksCiAgICAgICAgICAgICZwZWIu
UHJvY2Vzc1BhcmFtZXRlcnMsCiAgICAgICAgICAgIHNpemVvZiAocGViLlBy
b2Nlc3NQYXJhbWV0ZXJzKSwKICAgICAgICAgICAgJmJ5dGVzX2NvcGllZCkp
CiAgICB7CiAgICAgICAgc3dwcmludGYgKGJ1ZiwgX2NvdW50b2YgKGJ1Ziks
CiAgICAgICAgICAgICAgICAgIEwiW1tSZWFkUHJvY2Vzc01lbW9yeVtwZWJd
IEZBSUxFRDogJXVdXSIsCiAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCkg
R2V0TGFzdEVycm9yICgpKTsKICAgICAgICBjbWRsaW5lID0gd2NzZHVwIChi
dWYpOwogICAgICAgIGdvdG8gb3V0OwogICAgfQoKICAgIGlmICghUmVhZFBy
b2Nlc3NNZW1vcnkgKHByb2Nlc3MsCiAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAmcGViLlByb2Nlc3NQYXJhbWV0ZXJzLT5Db21tYW5kTGluZSwKICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICZwcGFyYW1zLkNvbW1hbmRMaW5l
LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mIChwcGFyYW1z
LkNvbW1hbmRMaW5lKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICZi
eXRlc19jb3BpZWQpKQogICAgewogICAgICAgIHN3cHJpbnRmIChidWYsIF9j
b3VudG9mIChidWYpLAogICAgICAgICAgICAgICAgICBMIltbUmVhZFByb2Nl
c3NNZW1vcnlbcHBhcmFtc10gRkFJTEVEOiAldV1dIiwKICAgICAgICAgICAg
ICAgICAgKHVuc2lnbmVkKSBHZXRMYXN0RXJyb3IgKCkpOwogICAgICAgIGNt
ZGxpbmUgPSB3Y3NkdXAgKGJ1Zik7CiAgICAgICAgZ290byBvdXQ7CiAgICB9
CgogICAgY21kbGluZV90bXAgPSBtYWxsb2MgKHBwYXJhbXMuQ29tbWFuZExp
bmUuTGVuZ3RoICsgc2l6ZW9mICh3Y2hhcl90KSk7CiAgICBpZiAoIVJlYWRQ
cm9jZXNzTWVtb3J5IChwcm9jZXNzLCBwcGFyYW1zLkNvbW1hbmRMaW5lLkJ1
ZmZlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNtZGxpbmVfdG1w
LCBwcGFyYW1zLkNvbW1hbmRMaW5lLkxlbmd0aCwKICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICZieXRlc19jb3BpZWQpKQogICAgewogICAgICAgIHN3
cHJpbnRmIChidWYsIF9jb3VudG9mIChidWYpLAogICAgICAgICAgICAgICAg
ICBMIltbUmVhZFByb2Nlc3NNZW1vcnlbY21kbGluZV0gRkFJTEVEOiAldV1d
IiwKICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkKSBHZ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ICAgICAgIERXT1JEIHBpZCA9IChEV09SRCkgb3ZlcmxhcHBl
ZDsKICAgICAgICAgICAgICAgIHdjaGFyX3QqIGNtZGxpbmUgPSBnZXRfcHJv
Y2Vzc19jb21tYW5kX2xpbmUgKHBpZCk7CiAgICAgICAgICAgICAgICBmcHJp
bnRmIChzdGRlcnIsICJuZXcgcHJvY2VzczogJXU6ICVTXG4iLAogICAgICAg
ICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkKSBwaWQsIGNtZGxpbmUpOwog
ICAgICAgICAgICAgICAgZnJlZSAoY21kbGluZSk7CiAgICAgICAgICAgIH0K
CiAgICAgICAgICAgIGdvdG8gZ2V0X25leHRfbWVzc2FnZTsKICAgICAgICB9
CgogICAgICAgIGNhc2UgSk9CX09CSkVDVF9NU0dfRVhJVF9QUk9DRVNTOgog
ICAgICAgICAgICBpZiAodmVyYm9zZV9tb24pIHsKICAgICAgICAgICAgICAg
IGZwcmludGYgKHN0ZGVyciwgInByb2Nlc3MgZXhpdGVkOiAldVxuIiwKICAg
ICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCkgb3ZlcmxhcHBlZCk7
CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGdvdG8gZ2V0X25leHRfbWVz
c2FnZTsKCiAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgZ290byBnZXRf
bmV4dF9tZXNzYWdlOwogICAgfQoKICAgIG91dDoKICAgIGlmICh2ZXJib3Nl
X21vbikgewogICAgICAgIGZwcmludGYgKHN0ZGVyciwgImpvYiBlbXB0eVxu
Iik7CiAgICB9CgogICAgcHRocmVhZF9raWxsIChtYWluX3RocmVhZCwgU0lH
VVNSMik7CiAgICBzbGVlcCAoMTApOwogICAgYXNzZXJ0ICghInNob3VsZCBo
YXZlIGV4aXRlZCBieSBub3ciKTsKICAgIGV4aXQgKDQpOwogICAgcmV0dXJu
IE5VTEw7Cn0KCmludAptYWluIChpbnQgYXJnYywgY2hhcioqIGFyZ3YpCnsK
ICAgIGludCBjOwogICAgaW50IHJldCA9IDE7CiAgICBIQU5ETEUgam9iOwog
ICAgaW50IGNoaWxkX3N0YXR1czsKICAgIHNpZ3NldF90IHdhaXRtYXNrOwog
ICAgc2lnc2V0X3Qgb3JpZ21hc2s7CiAgICBwaWRfdCBjaGlsZF9waWQ7CiAg
ICBpbnQgY2hpbGRfcGlwZVsyXTsKICAgIGludCBzaWc7CiAgICBEV09SRCBj
aGlsZF93MzJfcGlkOwogICAgSEFORExFIGNoaWxkX3Byb2NfaGFuZGxlOwog
ICAgSEFORExFIGtlcm5lbDMyZGxsOwogICAgT1NWRVJTSU9OSU5GTyB2ZXJz
aW9uX2luZm87CiAgICBwdGhyZWFkX3QgbW9uaXRvcl90aHJlYWQ7CiAgICBp
bnQgZXhpdF9hZnRlcl9zaWdjaGxkID0gMTsKCiAgICBzdGF0aWMgY29uc3Qg
c3RydWN0IG9wdGlvbgogICAgICAgIGxvbmdvcHRzW10gPQogICAgICAgIHsK
ICAgICAgICAgICAgLyogTmFtZSAgICAgICAgICAgaGFzX2FyZyAgZmxhZyAg
dmFsICovCiAgICAgICAgICAgIHsgImhlbHAiLCAgICAgICAgIDAsICAgICAg
IDAsICAgICdoJyB9LAogICAgICAgICAgICB7ICJ2ZXJzaW9uIiwgICAgICAw
LCAgICAgICAwLCAgICAnVicgfSwKICAgICAgICAgICAgeyAidmVyYm9zZSIs
ICAgICAgMCwgICAgICAgMCwgICAgJ3YnIH0sCiAgICAgICAgICAgIHsgIndh
aXQtYWxsIiwgICAgIDAsICAgICAgIDAsICAgICdhJyB9LAogICAgICAgICAg
ICB7IDAgfQogICAgICAgIH07CgogICAgd2hpbGUgKChjID0gZ2V0b3B0X2xv
bmcgKGFyZ2MsIGFyZ3YsICIrVmhsdmEiLCBsb25nb3B0cywgMCkpICE9IC0x
KSB7CiAgICAgICAgc3dpdGNoIChjKSB7CiAgICAgICAgICAgIGNhc2UgJ2gn
OgogICAgICAgICAgICAgICAgdXNhZ2UgKCk7CiAgICAgICAgICAgICAgICBy
ZXQgID0gMDsKICAgICAgICAgICAgICAgIGdvdG8gb3V0OwogICAgICAgICAg
ICBjYXNlICdWJzoKICAgICAgICAgICAgICAgIHZlcnNpbmZvICgpOwogICAg
ICAgICAgICAgICAgcmV0ID0gMDsKICAgICAgICAgICAgICAgIGdvdG8gb3V0
OwogICAgICAgICAgICBjYXNlICd2JzoKICAgICAgICAgICAgICAgIHZlcmJv
c2VfbW9uID0gMTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAg
ICBjYXNlICdhJzoKICAgICAgICAgICAgICAgIGV4aXRfYWZ0ZXJfc2lnY2hs
ZCA9IDA7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgZGVm
YXVsdDoKICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgUFJHTkFN
RSAiOiB1c2UgLS1oZWxwIGZvciB1c2FnZVxuIik7CiAgICAgICAgICAgICAg
ICBnb3RvIG91dDsKICAgICAgICB9CiAgICB9CgogICAgYXJnYyAtPSBvcHRp
bmQ7CiAgICBhcmd2ICs9IG9wdGluZDsKCiAgICBpZiAoYXJnYyA9PSAwKSB7
CiAgICAgICAgZnByaW50ZiAoc3RkZXJyLCBQUkdOQU1FICI6IG1pc3Npbmcg
UFJPR1JBTSBhcmd1bWVudFxuIik7CiAgICAgICAgZnByaW50ZiAoc3RkZXJy
LCBQUkdOQU1FICI6IHVzZSAtLWhlbHAgZm9yIHVzYWdlXG4iKTsKICAgICAg
ICBnb3RvIG91dDsKICAgIH0KCiAgICBrZXJuZWwzMmRsbCA9IENIS19XMzJf
SEFORExFIChMb2FkTGlicmFyeSAoTCJrZXJuZWwzMi5kbGwiKSk7CiAgICBY
SXNQcm9jZXNzSW5Kb2IgPSBHZXRQcm9jQWRkcmVzcyAoa2VybmVsMzJkbGws
ICJJc1Byb2Nlc3NJbkpvYiIpOwogICAgaWYgKFhJc1Byb2Nlc3NJbkpvYiA9
PSBOVUxMKSB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hlcl9zaWduYWw6CgogICAg
c3dpdGNoICgoc2lnID0gc2lnd2FpdGluZm8gKCZ3YWl0bWFzaywgTlVMTCkp
KSB7CiAgICAgICAgY2FzZSBTSUdDSExEOgogICAgICAgICAgICBpZiAodmVy
Ym9zZV9tb24pIHsKICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwg
IlNJR0NITERcbiIpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBpZiAo
ZXhpdF9hZnRlcl9zaWdjaGxkKSB7CiAgICAgICAgICAgICAgICBUZXJtaW5h
dGVKb2JPYmplY3QgKGpvYiwgMCk7CiAgICAgICAgICAgICAgICBnb3RvIGRv
bmU7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGdvdG8gZ2V0X2Fub3Ro
ZXJfc2lnbmFsOwogICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgIGZwcmlu
dGYgKHN0ZGVyciwgUFJHTkFNRSAiOiB1bmV4cGVjdGVkIHNpZ25hbCAlZDog
JXNcbiIsCiAgICAgICAgICAgICAgICAgICAgIHNpZywgc3RyZXJyb3IgKGVy
cm5vKSk7CiAgICAgICAgICAgIC8qIEZhbGwgdGhyb3VnaCAqLwogICAgICAg
IGNhc2UgU0lHSFVQOgogICAgICAgIGNhc2UgU0lHVEVSTToKICAgICAgICBj
YXNlIFNJR0lOVDoKICAgICAgICAgICAgLyogV2Ugd2VyZSBhc2tlZCB0byBx
dWl0LiAgS2lsbCBldmVyeXRoaW5nIGluIHRoZSBqb2IuICovCiAgICAgICAg
ICAgIENIS19XMzJfQk9PTCAoVGVybWluYXRlSm9iT2JqZWN0IChqb2IsIDEy
OCArIHNpZykpOwogICAgICAgICAgICBjaGlsZF9waWQgPSAwOyAvKiBEb24n
dCB1c2Ugd2FpdHBpZDsganVzdCByZXR1cm4gdGhlCiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIHNpZ25hbCArIDEyOCwgbGlrZSBhIHNoZWxsLiAq
LwogICAgICAgICAgICBnb3RvIGRvbmU7CiAgICAgICAgY2FzZSBTSUdVU1Iy
OgogICAgICAgICAgICBnb3RvIGRvbmU7CiAgICAgICAgY2FzZSBTSUdVU1Ix
OgogICAgICAgICAgICBwcmludF9hbGxfaW5fam9iIChqb2IpOwogICAgICAg
ICAgICBnb3RvIGdldF9hbm90aGVyX3NpZ25hbDsKICAgICAgICBjYXNlIFNJ
R1RTVFA6CiAgICAgICAgICAgIHN1c3BlbmRfYWxsX2luX2pvYiAoam9iKTsK
ICAgICAgICAgICAgcmFpc2UgKFNJR1NUT1ApOyAvKiBCbG9jayB1bnRpbCBz
b21lYm9keSByZXN1bWVzIHVzLiAqLwogICAgICAgICAgICByZXN1bWVfYWxs
ICgpOwogICAgICAgICAgICBnb3RvIGdldF9hbm90aGVyX3NpZ25hbDsKICAg
IH0KCiAgICBkb25lOgoKICAgIGlmIChjaGlsZF9waWQgPiAwKSB7CiAgICAg
ICAgQ0hLICh3YWl0ICgmY2hpbGRfc3RhdHVzKSk7CgogICAgICAgIHJldCA9
ICggV0lGRVhJVEVEIChjaGlsZF9zdGF0dXMpCiAgICAgICAgICAgICAgICA/
IFdFWElUU1RBVFVTIChjaGlsZF9zdGF0dXMpCiAgICAgICAgICAgICAgICA6
IDEyOCArIFdURVJNU0lHIChjaGlsZF9zdGF0dXMpICk7CiAgICB9IGVsc2Ug
ewogICAgICAgIHJldCA9IDEyOCArIHNpZzsKICAgIH0KCiAgICBvdXQ6CiAg
ICByZXR1cm4gcmV0Owp9Cg==

--------------090306080502090103040904--

--------------enig77974F43BAEA62474A7EAD45
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAk7cImUACgkQ17c2LVA10Vu3eQCbBJNFtKJuBerOfjVsPuj38ESK
dEwAn1+cNiQBZqRhkP1JF0K3GVIcHio1
=L2yN
-----END PGP SIGNATURE-----

--------------enig77974F43BAEA62474A7EAD45--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019