From 734bc0438e78b7c7cd34acfce3a4ec119d9a50b6 Mon Sep 17 00:00:00 2001 From: DragonBluep <70847398+DragonBluep@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:14:42 +0800 Subject: [PATCH] pppd: Make pid directory before creating the pid file (#536) If multilink feature is not enabled, the '/var/run/pppd' directory won't be created before adding pid file. Fixes error message: 'Failed to create pid file /var/run/pppd/pppoe-wan.pid: No such file or directory' Signed-off-by: Shiji Yang --- pppd/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/pppd/main.c b/pppd/main.c index 66db6a9..a4bc777 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -923,6 +923,7 @@ create_pidfile(int pid) { FILE *pidfile; + mkdir_recursive(PPP_PATH_VARRUN); slprintf(pidfilename, sizeof(pidfilename), "%s/%s.pid", PPP_PATH_VARRUN, ifname); if ((pidfile = fopen(pidfilename, "w")) != NULL) { -- 2.39.5