summaryrefslogtreecommitdiff
path: root/src/hibernate-resume
diff options
context:
space:
mode:
Diffstat (limited to 'src/hibernate-resume')
-rw-r--r--src/hibernate-resume/hibernate-resume.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/hibernate-resume/hibernate-resume.c b/src/hibernate-resume/hibernate-resume.c
index 8f68f81f9e..b234a0b49a 100644
--- a/src/hibernate-resume/hibernate-resume.c
+++ b/src/hibernate-resume/hibernate-resume.c
@@ -46,6 +46,10 @@ int main(int argc, char *argv[]) {
umask(0022);
+ /* Refuse to run unless we are in an initrd() */
+ if (!in_initrd())
+ return EXIT_SUCCESS;
+
device = argv[1];
if (stat(device, &st) < 0) {