Fix return codes, Gentoo #209369.
[openresolv] / libc.in
diff --git a/libc.in b/libc.in
index 9611402125f541137e0b01a2f665dd66b4095fa5..e1e9014f909cc817df71ca7f7fa8182306a798f3 100755 (executable)
--- a/libc.in
+++ b/libc.in
@@ -1,5 +1,4 @@
 #!/bin/sh
-# Copyright 2006 Gentoo Foundation
 # Copyright 2007 Roy Marples
 # All rights reserved
 
@@ -142,10 +141,13 @@ fi
 (umask 022; printf "${NEWCONF}" > "${RESOLVCONF}"/run/resolv.conf)
 
 resolvconf -s nscd restart
+retval=$?
 
 # Notify users of the resolver
 for x in "${REVOLVCONF}"/update-libc.d/*; do
-       [ -e "${x}" ] && "${x}" "$@"
+       if [ -e "${x}" ]; then
+               "${x}" "$@"
+               retval=$((${retval} + $?))
+       fi
 done
-
-# vim: ts=4 :
+exit ${retval}