[PATCH 2/5] initd: Re-use the watchdog_set_cloexec() function from, watchdog_open()

Michael Jones mike at meshplusplus.com
Tue Sep 29 12:22:12 EDT 2020


Signed-off-by: Michael Jones <mike at meshplusplus.com>
---
 watchdog.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/watchdog.c b/watchdog.c
index 9d770b4..20b6e20 100644
--- a/watchdog.c
+++ b/watchdog.c
@@ -65,8 +65,7 @@ static int watchdog_open(bool cloexec)
     if (wdt_fd < 0)
         return wdt_fd;
 
-    if (cloexec)
-        fcntl(wdt_fd, F_SETFD, fcntl(wdt_fd, F_GETFD) | FD_CLOEXEC);
+    watchdog_set_cloexec(cloexec);
 
     return wdt_fd;
 }
-- 
2.26.2




More information about the openwrt-devel mailing list