summaryrefslogtreecommitdiff
path: root/src/hibernate-resume/hibernate-resume.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-28 20:24:12 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-28 20:26:14 +0200
commitac528e3e3b93981cc9692250556b113acce7eb17 (patch)
tree27a3466e8ad74dd3c65fee60039350b584bc0dfa /src/hibernate-resume/hibernate-resume.c
parent202aea456dfb279cd34da7bfd1880f6ac0fd849f (diff)
hibernate-resume: refuse to run outside of an initrd
Diffstat (limited to 'src/hibernate-resume/hibernate-resume.c')
-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) {