Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
System
KPMCore
Commits
29109ffc
Commit
29109ffc
authored
Nov 12, 2021
by
Andrius Štikonas
Browse files
Fix seek error when filling device with random data or zeroes.
parent
d46991d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/util/externalcommandhelper.cpp
View file @
29109ffc
...
...
@@ -80,7 +80,8 @@ bool ExternalCommandHelper::readData(const QString& sourceDevice, QByteArray& bu
return
false
;
}
if
(
!
device
.
seek
(
offset
))
{
// Sequential devices such as /dev/zero or /dev/urandom return false on seek().
if
(
!
device
.
isSequential
()
&&
!
device
.
seek
(
offset
))
{
qCritical
()
<<
xi18n
(
"Could not seek position %1 on device <filename>%2</filename>."
,
offset
,
sourceDevice
);
return
false
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment