Author: markj
Date: Wed Jul 26 17:36:58 2017
New Revision: 321569
URL: https://svnweb.freebsd.org/changeset/base/321569

Log:
  MFC r321228:
  Allow matches of truncated version strings.

Modified:
  stable/11/usr.sbin/crashinfo/crashinfo.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/crashinfo/crashinfo.sh
==============================================================================
--- stable/11/usr.sbin/crashinfo/crashinfo.sh   Wed Jul 26 17:36:30 2017        
(r321568)
+++ stable/11/usr.sbin/crashinfo/crashinfo.sh   Wed Jul 26 17:36:58 2017        
(r321569)
@@ -69,10 +69,12 @@ find_kernel()
                }
        }' $INFO)
 
-       # Look for a matching kernel version.
+       # Look for a matching kernel version, handling possible truncation
+       # of the version string recovered from the dump.
        for k in `sysctl -n kern.bootfile` $(ls -t /boot/*/kernel); do
-               kvers=$(gdb_command $k 'printf "  Version String: %s", version' 
\
-                    2>/dev/null)
+               kvers=$(gdb_command $k 'printf "  Version String: %s", version' 
| \
+                   awk "{line=line\$0\"\n\"} END{print 
substr(line,1,${#ivers})}" \
+                   2>/dev/null)
                if [ "$ivers" = "$kvers" ]; then
                        KERNEL=$k
                        break
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to