(get_myaddress): Avoid loopback interfaces, return loopback address
[kopensolaris-gnu/glibc.git] / mkinstalldirs
index b044a33..d0fd194 100755 (executable)
@@ -4,6 +4,8 @@
 # Created: 1993-05-16
 # Public domain
 
+# $Id$
+
 errstatus=0
 
 for file
@@ -12,16 +14,21 @@ do
    shift
 
    pathcomp=
-   for d in ${1+"$@"} ; do
+   for d
+   do
      pathcomp="$pathcomp$d"
      case "$pathcomp" in
        -* ) pathcomp=./$pathcomp ;;
      esac
 
-     # Test `DIR/.' so that we see a symlink to a directory as a directory.
-     if test ! -d "$pathcomp"/.; then
+     if test ! -d "$pathcomp"; then
         echo "mkdir $pathcomp" 1>&2
-        mkdir "$pathcomp" || errstatus=$?
+
+        mkdir "$pathcomp" || lasterr=$?
+
+        if test ! -d "$pathcomp"; then
+         errstatus=$lasterr
+        fi
      fi
 
      pathcomp="$pathcomp/"