summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2025-08-03 04:16:42 +0000
committerFelix Fietkau2025-08-03 04:16:44 +0000
commitb563d7b2e65a756e02c579f51e3ca0211f741050 (patch)
tree83272e14241336f6d69ba8371dc0832739223937
parent74c22601baad83cc9bc0fddb98f15d7abaa52c67 (diff)
downloadnetifd-b563d7b2e65a756e02c579f51e3ca0211f741050.tar.gz
ucode: add missing return code checks for fchdir/chdir
Fixes build issue on glibc Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--ucode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ucode.c b/ucode.c
index a1b67f5..fdddab7 100644
--- a/ucode.c
+++ b/ucode.c
@@ -333,10 +333,12 @@ uc_netifd_start_process(uc_value_t *dir, uc_value_t *arg, uc_value_t *env, int *
break;
fallthrough;
case UC_INTEGER:
- fchdir(ucv_int64_get(dir));
+ if (fchdir(ucv_int64_get(dir)) < 0)
+ exit(1);
break;
case UC_STRING:
- chdir(ucv_string_get(dir));
+ if (chdir(ucv_string_get(dir)) < 0)
+ exit(1);
break;
default:
break;