pbsh.s: try making shell interruptable when reading from a file
This commit is contained in:
+4
-6
@@ -52,19 +52,17 @@
|
|||||||
" argptr, and copy the names up).
|
" argptr, and copy the names up).
|
||||||
maxargs=10
|
maxargs=10
|
||||||
|
|
||||||
lac d1
|
|
||||||
sys intrp " make shell uninterruptable
|
|
||||||
|
|
||||||
" see if reading from a special file
|
" see if reading from a special file
|
||||||
cla; sys seek; 1; 0 " try seeking stdin forward
|
cla; sys seek; 1; 0 " try seeking stdin forward one word
|
||||||
sna " new offset non-zero?
|
sna " new offset non-zero?
|
||||||
jmp 1f " no: input is a special file (ttyin,keyboard)
|
jmp 1f " no: input is a special file (ttyin,keyboard)
|
||||||
dzm prompt " yes: regular file, kill prompt
|
dzm prompt " yes: regular file, kill prompt
|
||||||
cla; sys seek; 0; 0 " seek file back to start
|
cla; sys seek; 0; 0 " seek file back to start
|
||||||
jmp newline
|
jmp newline
|
||||||
|
|
||||||
" stdin is a special file, see if superuser
|
1: lac d1
|
||||||
1: sys getuid
|
sys intrp " make shell uninterruptable
|
||||||
|
sys getuid
|
||||||
sma " <0?
|
sma " <0?
|
||||||
jmp newline " no
|
jmp newline " no
|
||||||
lac hash " yes: superuser
|
lac hash " yes: superuser
|
||||||
|
|||||||
Reference in New Issue
Block a user