Skip to content

Commit

Permalink
AIX fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bpbecker committed Nov 29, 2021
1 parent 4c461ba commit 3d9148c
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions Source/isolate/APLProcess.dyalog
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

rVersion
:Access Public Shared
r'APLProcess' '2.2' '15 June 2021'
r'APLProcess' '2.2.1' '29 November 2021'

:Field Public Args''
Expand Down Expand Up @@ -34,6 +34,11 @@
r'Mac'Platform

rIsAIX
:Access public shared
r'AIX'Platform

rPlatform
:Access public shared
r3#.⎕WG'APLVersion'
Expand Down Expand Up @@ -127,7 +132,7 @@
ProcSshProc host port keyfile cmd
:Else
zGetCurrentProcessId
output(1+×OUT_FILE)'/dev/null'OUT_FILE
output(1+×OutFile)'/dev/null'OutFile
cmd,'{ ',args,' ',Exe,' +s -q ',ws,' -c APLppid=',z,' </dev/null >',output,' 2>&1 & } ; echo $!'
pid_SH cmd
Proc.Idpid
Expand Down Expand Up @@ -447,18 +452,27 @@

rUNIXGetShortCmd pid;cmd
Retrieve sort form of cmd used to start process <pid>
cmd(1+IsMac)'cmd' 'command'
cmd'ps -o ',cmd,' -p ',(pid),' 2>/dev/null ; exit 0'
cmd(IsMac,IsAIX,1)/'comm' 'command' 'cmd'
cmd'-o ',cmd,' -p ',pid
:If {2::0 IsSsh}'' instance?
∘∘∘
:Else
r1⎕SH cmd
:Trap 11
r_PS cmd
:Else
r''
:EndTrap
:EndIf

r_PS cmd;ps
ps'ps ',('AIX'3'.'⎕WG'APLVersion')/'/usr/sysv/bin/' Must use this ps on AIX
r1⎕SH ps,cmd,' 2>/dev/null; exit 0' Remove header line
ps'ps ',IsAIX/'/usr/sysv/bin/' Must use this ps on AIX
:Trap 0
r1⎕SH ps,cmd,' 2>ps.log; exit 0' Remove header line
:Else
(⎕JSON'Compact' 0⎕DMX)⎕NPUT'ps.log' 2
⎕DMX.Message ⎕SIGNAL ⎕DMX.EN
:EndTrap

r{quietly}_SH cmd
Expand Down

0 comments on commit 3d9148c

Please sign in to comment.