Skip to content

Commit 261a2b3

Browse files
committed
common/rc: Make _test_dev_queue_set() failures easier to debug
If modifying a /sys/class/block/*/queue attribute fails, show the path involved in the write failure. Signed-off-by: Bart Van Assche <[email protected]>
1 parent fc04d40 commit 261a2b3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

common/rc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,10 @@ _test_dev_queue_set() {
343343
${SYSFS_QUEUE_SAVED["$path"]-unset} == unset ]]; then
344344
SYSFS_QUEUE_SAVED["$path"]="$(_test_dev_queue_get "$1")"
345345
fi
346-
echo "$2" >"$path"
346+
if ! echo "$2" >"$path"; then
347+
echo "echo $2 > $path failed"
348+
return 1
349+
fi
347350
}
348351

349352
_test_dev_set_scheduler() {

0 commit comments

Comments
 (0)