Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PM / hibernate: Documentation: Fix script for unswapping

System can have mmaped also character devices (e.g dri devices by X) or deleted
files. Running cat on character devices is really bad idea (system can hang) so
run cat only on regular files. Also mmaped files can have spaces in filenames.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
[rjw: Subject]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Pali Rohár and committed by
Rafael J. Wysocki
8a54cd5b aa9abe2c

+4 -1
+4 -1
Documentation/power/swsusp.txt
··· 220 220 221 221 A: Try running 222 222 223 - cat `cat /proc/[0-9]*/maps | grep / | sed 's:.* /:/:' | sort -u` > /dev/null 223 + cat /proc/[0-9]*/maps | grep / | sed 's:.* /:/:' | sort -u | while read file 224 + do 225 + test -f "$file" && cat "$file" > /dev/null 226 + done 224 227 225 228 after resume. swapoff -a; swapon -a may also be useful. 226 229