diff mbox series

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

Message ID e0774132-1795-337a-5dec-07e5a257186e@meshplusplus.com
State Changes Requested
Headers show
Series [1/5] initd: Add ubus argument to trigger watchdog tickle. | expand

Commit Message

Michael Jones Sept. 29, 2020, 4:22 p.m. UTC
Signed-off-by: Michael Jones <mike@meshplusplus.com>
---
 watchdog.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

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;
 }