Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sbin/devpubd/hooks Pull up following revision(s) (request...
details: https://anonhg.NetBSD.org/src/rev/f9e116f190e4
branches: netbsd-7
changeset: 799055:f9e116f190e4
user: snj <snj%NetBSD.org@localhost>
date: Sat Mar 07 06:00:01 2015 +0000
description:
Pull up following revision(s) (requested by mlelstv in ticket #561):
sbin/devpubd/hooks/02-wedgenames: revision 1.3
safely update existing wedge links
diffstat:
sbin/devpubd/hooks/02-wedgenames | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diffs (27 lines):
diff -r 6969b19afbc4 -r f9e116f190e4 sbin/devpubd/hooks/02-wedgenames
--- a/sbin/devpubd/hooks/02-wedgenames Sat Mar 07 05:27:53 2015 +0000
+++ b/sbin/devpubd/hooks/02-wedgenames Sat Mar 07 06:00:01 2015 +0000
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: 02-wedgenames,v 1.1.12.1 2015/02/17 14:45:31 martin Exp $
+# $NetBSD: 02-wedgenames,v 1.1.12.2 2015/03/07 06:00:01 snj Exp $
#
# Try to maintain symlinks to wedge devices
#
@@ -52,7 +52,14 @@
test -d $wedgedir || mkdir -m 755 $wedgedir
basedir=$(dirname "$wedgedir/$n")
test -d "$basedir" || mkdir -p -m 755 "$basedir"
- ln -s "/dev/$1" "$wedgedir/$n"
+ if oldlink=$(readlink "$wedgedir/$n"); then
+ if [ x"$oldlink" != "/dev/$1" ]; then
+ rm -f "$wedgedir/$n"
+ ln -s "/dev/$1" "$wedgedir/$n"
+ fi
+ else
+ ln -s "/dev/$1" "$wedgedir/$n"
+ fi
;;
esac
}
Home |
Main Index |
Thread Index |
Old Index