From 29eb4a5b06471976df721b353f8f14028dcfbef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= Date: Wed, 29 Jan 2020 22:07:51 -0600 Subject: [PATCH] rmtfs.c: Exit when fail to get rprocfd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When -s option is specified rmtfs handled the start of rproc but at init may be the /sys entries are not fully populated yet due to module load/setup so exit with 1 and let systemd restart the service. Signed-off-by: Aníbal Limón --- rmtfs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rmtfs.c b/rmtfs.c index dae6820..795c021 100644 --- a/rmtfs.c +++ b/rmtfs.c @@ -517,6 +517,11 @@ int main(int argc, char **argv) /* enable sync for the mss rproc instance */ case 's': rprocfd = rproc_init(); + if (rprocfd < 0) { + fprintf(stderr, "Failed to get rprocfd\n"); + return 1; + } + break; /* -v is for verbose */