Re: [PATCH 4/5] set: check seek success

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/02/2014 02:16 AM, Patrick Georgi wrote:
This could silently fail which leads to surprising behaviour.

diff --git a/src/set.c b/src/set.c

-	fseek(fp, offset, SEEK_SET);
+	if (!fseek(fp, offset, SEEK_SET)) {

fseek is supposed to return the current offset, or -1 on error. I think that should say if (fseek(...) < 0) or if (fseek(...) == -1)) or if (fseek(...) != offset).
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux