Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

needs-restarting: "Regular files" are often on 00:xx devices #559

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions plugins/needs_restarting.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ def smap2opened_file(pid, line):
slash = line.find('/')
if slash < 0:
return None
if line.find('00:') >= 0:
# not a regular file
return None
fn = line[slash:].strip()
suffix_index = fn.rfind(' (deleted)')
if suffix_index < 0:
Expand Down
5 changes: 2 additions & 3 deletions tests/test_needs_restarting.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@

DEL_FILE = '3dcf000000-3dcf032000 r-xp 00000000 08:02 140759 ' \
' /usr/lib64/libXfont.so.1.4.1;5408628d (deleted)'
MM_FILE = '7fc4e1168000-7fc4e1169000 rw-s 1096dd000 00:05 7749' \
' /dev/dri/card0'
HEAP_FILE = '556d60d52000-556d60e1c000 rw-p 00000000 00:00 0 [heap]'
SO_FILE = '30efe06000-30efe07000 r--p 00006000 08:02 139936' \
' /usr/lib64/libSM.so.6.0.1'
class NeedsRestartingTest(tests.support.TestCase):
def test_smap2opened_file(self):
func = needs_restarting.smap2opened_file
self.assertIsNone(func(1, 'Shared_Dirty: 0 kB'))
self.assertIsNone(func(1, MM_FILE))
self.assertIsNone(func(1, HEAP_FILE))

ofile = func(5, SO_FILE)
self.assertFalse(ofile.deleted)
Expand Down
Loading