watchfrr: Fail gracefully if fopen fails

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2017-12-04 21:26:05 -05:00
parent 116e176d99
commit f5ba21fc9d

View File

@ -596,7 +596,8 @@ static void daemon_send_ready(void)
FILE *fp;
fp = fopen(DAEMON_VTY_DIR "/watchfrr.started", "w");
fclose(fp);
if (fp)
fclose(fp);
#if defined HAVE_SYSTEMD
zlog_notice(
"Watchfrr: Notifying Systemd we are up and running");