Add parenthesis in examples
This commit is contained in:
parent
8821a0b823
commit
6bd2e7b891
3 changed files with 14 additions and 14 deletions
14
README.md
14
README.md
|
@ -20,9 +20,9 @@ manual page for more details:
|
|||
#!/usr/bin/env ruby
|
||||
require "bsd/capsicum"
|
||||
|
||||
print "In capability mode: ", BSD::Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
||||
print "Enter capability mode: ", BSD::Capsicum.enter! ? "ok" : "error", "\n"
|
||||
print "In capability mode: ", BSD::Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
||||
print "In capability mode: ", (BSD::Capsicum.in_capability_mode? ? "yes" : "no"), "\n"
|
||||
print "Enter capability mode: ", (BSD::Capsicum.enter! ? "ok" : "error"), "\n"
|
||||
print "In capability mode: ", (BSD::Capsicum.in_capability_mode? ? "yes" : "no"), "\n"
|
||||
|
||||
begin
|
||||
File.new(File::NULL)
|
||||
|
@ -48,15 +48,15 @@ certain tasks but with restrictions in place:
|
|||
#!/usr/bin/env ruby
|
||||
require "bsd/capsicum"
|
||||
|
||||
print "[parent] In capability mode: ", BSD::Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
||||
print "[parent] In capability mode: ", (BSD::Capsicum.in_capability_mode? ? "yes" : "no"), "\n"
|
||||
fork do
|
||||
print "[subprocess] Enter capability mode: ", BSD::Capsicum.enter! ? "ok" : "error", "\n"
|
||||
print "[subprocess] In capability mode: ", BSD::Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
||||
print "[subprocess] Enter capability mode: ", (BSD::Capsicum.enter! ? "ok" : "error"), "\n"
|
||||
print "[subprocess] In capability mode: ", (BSD::Capsicum.in_capability_mode? ? "yes" : "no"), "\n"
|
||||
print "[subprocess] Exit", "\n"
|
||||
exit 42
|
||||
end
|
||||
Process.wait
|
||||
print "[parent] In capability mode: ", BSD::Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
||||
print "[parent] In capability mode: ", (BSD::Capsicum.in_capability_mode? ? "yes" : "no"), "\n"
|
||||
|
||||
##
|
||||
# [parent] In capability mode: no
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
require "bundler/setup"
|
||||
require "bsd/capsicum"
|
||||
|
||||
print "In capability mode: ", BSD::Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
||||
print "Enter capability mode: ", BSD::Capsicum.enter! ? "ok" : "error", "\n"
|
||||
print "In capability mode: ", BSD::Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
||||
print "In capability mode: ", (BSD::Capsicum.in_capability_mode? ? "yes" : "no"), "\n"
|
||||
print "Enter capability mode: ", (BSD::Capsicum.enter! ? "ok" : "error"), "\n"
|
||||
print "In capability mode: ", (BSD::Capsicum.in_capability_mode? ? "yes" : "no"), "\n"
|
||||
|
||||
begin
|
||||
File.new(File::NULL)
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
require "bundler/setup"
|
||||
require "bsd/capsicum"
|
||||
|
||||
print "[parent] In capability mode: ", BSD::Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
||||
print "[parent] In capability mode: ", (BSD::Capsicum.in_capability_mode? ? "yes" : "no"), "\n"
|
||||
fork do
|
||||
print "[subprocess] Enter capability mode: ", BSD::Capsicum.enter! ? "ok" : "error", "\n"
|
||||
print "[subprocess] In capability mode: ", BSD::Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
||||
print "[subprocess] Enter capability mode: ", (BSD::Capsicum.enter! ? "ok" : "error"), "\n"
|
||||
print "[subprocess] In capability mode: ", (BSD::Capsicum.in_capability_mode? ? "yes" : "no"), "\n"
|
||||
print "[subprocess] Exit", "\n"
|
||||
exit 42
|
||||
end
|
||||
Process.wait
|
||||
print "[parent] In capability mode: ", BSD::Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
||||
print "[parent] In capability mode: ", (BSD::Capsicum.in_capability_mode? ? "yes" : "no"), "\n"
|
||||
|
||||
##
|
||||
# [parent] In capability mode: no
|
||||
|
|
Loading…
Reference in a new issue