summaryrefslogtreecommitdiff
path: root/libexec/ld.so
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/ld.so')
-rw-r--r--libexec/ld.so/ldconfig/ldconfig.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libexec/ld.so/ldconfig/ldconfig.c b/libexec/ld.so/ldconfig/ldconfig.c
index 6511c8a218d..96c3ff723c6 100644
--- a/libexec/ld.so/ldconfig/ldconfig.c
+++ b/libexec/ld.so/ldconfig/ldconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldconfig.c,v 1.37 2018/04/26 12:42:50 guenther Exp $ */
+/* $OpenBSD: ldconfig.c,v 1.38 2018/06/08 19:24:46 cheloha Exp $ */
/*
* Copyright (c) 1993,1995 Paul Kranenburg
@@ -386,7 +386,10 @@ buildhints(void)
warn("%s", tmpfilenam);
goto out;
}
- fchmod(fd, 0444);
+ if (fchmod(fd, 0444) == -1) {
+ warn("%s: failed to change mode", tmpfilenam);
+ goto out;
+ }
if (write(fd, &hdr, sizeof(struct hints_header)) !=
sizeof(struct hints_header)) {