From: DragonBluep <70847398+DragonBluep@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:14:42 +0000 (+0800) Subject: pppd: Make pid directory before creating the pid file (#536) X-Git-Tag: v2.5.2~7 X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=734bc0438e78b7c7cd34acfce3a4ec119d9a50b6;p=ppp.git 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 --- 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) {