# File lib/puppet/util/selinux.rb, line 140
140:   def read_mounts
141:     mounts = ""
142:     begin
143:       if File.instance_methods.include? "read_nonblock"
144:         # If possible we use read_nonblock in a loop rather than read to work-
145:         # a linux kernel bug.  See ticket #1963 for details.
146:         mountfh = File.open("/proc/mounts")
147:         mounts += mountfh.read_nonblock(1024) while true
148:       else
149:         # Otherwise we shell out and let cat do it for us
150:         mountfh = IO.popen("/bin/cat /proc/mounts")
151:         mounts = mountfh.read
152:       end
153:     rescue EOFError
154:       # that's expected
155:     rescue
156:       return nil
157:     ensure
158:       mountfh.close if mountfh
159:     end
160: 
161:     mntpoint = {}
162: 
163:     # Read all entries in /proc/mounts.  The second column is the
164:     # mountpoint and the third column is the filesystem type.
165:     # We skip rootfs because it is always mounted at /
166:     mounts.collect do |line|
167:       params = line.split(' ')
168:       next if params[2] == 'rootfs'
169:       mntpoint[params[1]] = params[2]
170:     end
171:     mntpoint
172:   end