Commit 67af4d2d authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov

Fix misleading error message

This message is shown if fcntl() fails (for any reason)

	ioping: fcntl failed, please retry without -D: Invalid argument

First, it tells that -D is invalid argument, which is misleading.

Second it tells to retry with -D even if -D was not used.

Fix it, now the message is:

	ioping: fcntl failed: Invalid argument
	Please retry without -D
Signed-off-by: default avatarKir Kolyshkin <kir@openvz.org>
parent 772e8b33
...@@ -380,8 +380,13 @@ int main (int argc, char **argv) ...@@ -380,8 +380,13 @@ int main (int argc, char **argv)
err(1, "failed to create temporary file at \"%s\"", path); err(1, "failed to create temporary file at \"%s\"", path);
if (unlink(temp)) if (unlink(temp))
err(1, "unlink \"%s\" failed", temp); err(1, "unlink \"%s\" failed", temp);
if (fcntl(fd, F_SETFL, flags)) if (fcntl(fd, F_SETFL, flags)) {
err(1, "fcntl failed, please retry without -D"); warn("fcntl failed");
if (direct)
fprintf(stderr, "Please retry without -D\n");
exit(1);
}
for (woffset = 0 ; woffset + size <= wsize ; woffset += size) { for (woffset = 0 ; woffset + size <= wsize ; woffset += size) {
if (pwrite(fd, buf, size, offset + woffset) != size) if (pwrite(fd, buf, size, offset + woffset) != size)
err(1, "write failed"); err(1, "write failed");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment