Fix regression when no PID file
cover Fix regression when no PID file
Following patch is a fix for regression introduced by commit b7d7837128e9 ("Monitor: open file before check in check_one_sharer()").
This prevented Monitor from starting if there was no PID file in /run/mdadm.
Mateusz Kusiak (1):
Monitor: Allow no PID in check_one_sharer()
Monitor.c | 5 +++++ 1 file changed, 5 insertions(+)
Signature · 1 line
2.35.3
PATCH 1/1 Monitor: Allow no PID in check_one_sharer()
Commit 5fb5479ad100 ("Monitor: open file before check in check_one_sharer()") introduced a regression that prohibits monitor from starting if PID file does not exist.
Add check for no PID file.
Add missing fclose().
--- Monitor.c | 5 +++++ 1 file changed, 5 insertions(+)
Monitor.c +5 -0
@@ -453,12 +453,17 @@ static int check_one_sharer(int scan) fp =fopen (AUTOREBUILD_PID_PATH ,"r" );if (!fp) { +/* PID file does not exist */ +if (errno ==ENOENT ) +return 0 ; +pr_err ("Cannot open %s file.\n" ,AUTOREBUILD_PID_PATH );return 2 ; }if (!is_file (AUTOREBUILD_PID_PATH )) {pr_err ("%s is not a regular file.\n" ,AUTOREBUILD_PID_PATH ); +fclose (fp);return 2 ; }
Signature · 1 line
2.35.3
Mariusz Tkaczyk
AppliedQuoted 12 lines · On Wed, 28 Feb 2024 16:37:19 +0100 Mateusz Kusiak <[email protected]>…
Following patch is a fix for regression introduced by commit
b7d7837128e9("Monitor: open file before check incheck_one_sharer()").This prevented Monitor from starting if there was no PID file in
/run/mdadm.Mateusz Kusiak (1):
Monitor: Allow no PID incheck_one_sharer()Monitor.c | 5 +++++ 1 file changed, 5 insertions(+)
Applied!
Thanks,
Mariusz