Merge lp:~jontai/openvista-gtm-integration/bug357918 into lp:openvista-gtm-integration

Proposed by Jon Tai
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jontai/openvista-gtm-integration/bug357918
Merge into: lp:openvista-gtm-integration
Diff against target: None lines
To merge this branch: bzr merge lp:~jontai/openvista-gtm-integration/bug357918
Reviewer Review Type Date Requested Status
jeff.apple Approve
Review via email: mp+7358@code.launchpad.net
To post a comment you must log in.
Revision history for this message
jeff.apple (jeff-apple) wrote :

DEVOPN now returns different results than it did before. However, the new result set looks correct.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mumps/ZOSVGUX.m'
2--- mumps/ZOSVGUX.m 2009-06-02 00:08:14 +0000
3+++ mumps/ZOSVGUX.m 2009-06-11 20:20:10 +0000
4@@ -1,4 +1,4 @@
5-%ZOSV ;SFISC/AC,PUG/TOAD,HOU/DHW,MSC/JDA/JKT - View commands & special functions. ;1JUN2009
6+%ZOSV ;SFISC/AC,PUG/TOAD,HOU/DHW,MSC/JDA/JKT - View commands & special functions. ;11JUN2009
7 ;;8.0;KERNEL;**275,MSC**;Jul 10, 1995
8 ;
9 ACTJ() ; # active jobs
10@@ -79,12 +79,10 @@
11 Q X
12 ;
13 JOBPAR ; <=====
14- N %FILE S %FILE=$$PWD^%ZISH_"zosv_jobpar_"_$J_".tmp"
15- ZSYSTEM "ps c -p "_X_"|tail -1>"_%FILE
16- N %I S %I=$I
17- O %FILE
18- U %FILE R Y U %I
19- C %FILE:DELETE
20+ ; See if X points to a valid Job. Return its UCI.
21+ ; FIXME: currently returns "VAH,ROU" instead of the real UCI (or "" if X is not
22+ ; the $J of a mumps process)
23+ S Y=$$RETURN("ps c -p "_X_" | tail -1")
24 F Q:$E(Y)'=" " S $E(Y)=""
25 I +Y=X,$E(Y,$L(Y)-4,$L(Y))="mumps" S Y="VAH,ROU"
26 E S Y=""
27@@ -202,43 +200,32 @@
28 ;
29 PIDOPN ; give a list of of all JOBS that have the current device open
30 ; returns comma separated in Y
31- N %FILE S %FILE=$$TEMP_"zosv_pidopn_"_$J_".tmp"
32- ZSYSTEM "lsof -F Pc "_$I_" >"_%FILE
33- N %I,%X,%Y S %I=$I
34- O %FILE
35- N %I,%X,%Y S %I=$I
36- U %FILE
37+ N %PIPE S %PIPE="lsof"
38+ O %PIPE:(COMMAND="lsof -F Pc "_$I:READONLY)::"PIPE"
39+ N %I,%X,%Y S %I=$I
40+ U %PIPE
41 F %Y=0:1 R %X Q:%X="" S %Y(%Y\2,$S($E(%X)="p":"PID",$E(%X)="c":"CMD",1:"?"))=$E(%X,2,$L(%X))
42 U %I
43- C %FILE:(DELETE)
44+ C %PIPE
45 S (Y,%X)="" F S %X=$O(%Y(%X)) Q:%X="" I %Y(%X,"CMD")="mumps" S Y=Y_","_%Y(%X,"PID")
46+ S $E(Y)=""
47 Q
48 ;
49 DEVOPN ;List of Devices opened
50 ;Returns variable Y. Y=Devices owned separated by a comma
51- ; ZSHOW "D":Y
52- N %FILE S %FILE=$$TEMP_"zosv_devopn_"_$J_".tmp"
53- ZSYSTEM "lsof -F n -p "_$J_" >"_%FILE
54- N %I,%X,%Y S %I=$I
55- O %FILE
56- U %FILE
57- F %Y=0:1 R %X Q:%X="" S %Y($S($E(%X)="p":"PID",$E(%X)="n":%Y,1:"?"))=$E(%X,2,$L(%X))
58- U %I
59- C %FILE:(DELETE)
60- I %Y("PID")'=$J S Y="" Q
61- I $D(%Y("?")) S Y="" Q
62- K %Y("PID"),%Y("?")
63- S (Y,%X)="" F S %X=$O(%Y(%X)) Q:%X="" S Y=Y_","_%Y(%X)
64+ N %D,%I
65+ S Y=""
66+ ZSHOW "D":%D
67+ S %I="" F S %I=$O(%D("D",%I)) Q:%I="" S Y=Y_","_$P(%D("D",%I)," OPEN ")
68+ S $E(Y)=""
69 Q
70 ;
71 RETURN(%COMMAND) ; ** Private Entry Point: execute a shell command & return the resulting value **
72 ;
73 ; %COMMAND is the string value of the Linux command
74- N %VALUE S %VALUE="" ; value to return
75- N %FILE S %FILE=$$TEMP_"RET"_$J_".txt" ; temporary results file
76- ZSYSTEM %COMMAND_" > "_%FILE ; execute command & save result
77- O %FILE:(REWIND) U %FILE R:'$ZEOF %VALUE C %FILE:(DELETE) ; fetch value & delete file
78- ;
79+ N %PIPE,%VALUE
80+ S %PIPE="pipe"
81+ O %PIPE:(COMMAND=%COMMAND:READONLY)::"PIPE" U %PIPE R %VALUE C %PIPE
82 QUIT %VALUE ; return value
83 ;
84 ;

Subscribers

People subscribed via source and target branches