From 71cd8e3a743046573744123777061b64881bf372 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sat, 4 Jul 2015 17:13:50 +0300 Subject: Imported Upstream version 8.24 --- tests/misc/head-c.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tests/misc/head-c.sh') diff --git a/tests/misc/head-c.sh b/tests/misc/head-c.sh index d6433d0d..a553a55b 100755 --- a/tests/misc/head-c.sh +++ b/tests/misc/head-c.sh @@ -1,7 +1,7 @@ #!/bin/sh # exercise head -c -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -42,4 +42,16 @@ esac # based on the value passed to -c (ulimit -v 20000; head --bytes=-$SSIZE_MAX < /dev/null) || fail=1 +# Make sure it works on funny files in /proc and /sys. + +for file in /proc/version /sys/kernel/profiling; do + if test -r $file; then + cp -f $file copy && + head -c -1 copy > exp1 || framework_failure_ + + head -c -1 $file > out1 || fail=1 + compare exp1 out1 || fail=1 + fi +done + Exit $fail -- cgit v1.2.3