From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: =?UTF-8?q?Ulrich=20=C3=96lmann?= Date: Mon, 30 Sep 2019 09:26:01 +0200 Message-Id: <20190930072613.17956-2-u.oelmann@pengutronix.de> In-Reply-To: <20190930072613.17956-1-u.oelmann@pengutronix.de> References: <20190930072613.17956-1-u.oelmann@pengutronix.de> MIME-Version: 1.0 Subject: [OSS-Tools] [PATCH dt-utils 01/13] state: Fix lseek error check in state_backend_bucket_direct_read() List-Id: Pengutronix Public Open-Source-Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: oss-tools-bounces@pengutronix.de Sender: "OSS-Tools" To: Pengutronix Public Open-Source-Development Cc: =?UTF-8?q?Ulrich=20=C3=96lmann?= VGhpcyBwb3J0cyB0aGUgZm9sbG93aW5nIGJhcmVib3ggY29tbWl0OgoKfCBjb21taXQgMjE5Yjk1 NGExMWU4MmFmYmJkN2I2ZWYxM2Q4YzViYTk0YTViMGZmMwp8IEF1dGhvcjogQW5kcmV5IFNtaXJu b3YgPGFuZHJldy5zbWlybm92QGdtYWlsLmNvbT4KfCBEYXRlOiAgIFdlZCBNYXIgNiAyMzo0OToy MSAyMDE5IC0wODAwCnwKfCAgICAgc3RhdGU6IEZpeCBsc2VlayBlcnJvciBjaGVjayBpbiBzdGF0 ZV9iYWNrZW5kX2J1Y2tldF9kaXJlY3RfcmVhZCgpCnwKfCAgICAgRG9uJ3QgdXNlICdpbnQnIHRv IHN0b3JlIGxzZWVrKCkncyByZXR1cm4gdmFsdWUgdG8gYXZvaWQgcHJvYmxlbXMgd2l0aAp8ICAg ICBsYXJnZSBzZWVrIG9mZnNldHMuIFdoaWxlIGF0IGl0LCBtYWtlIHN1cmUgdG8gcG9wdWxhdGUg cmV0dXJuIGVycm9yCnwgICAgIGNvZGUgZnJvbSAnZXJybm8nLgp8CnwgICAgIFNpZ25lZC1vZmYt Ynk6IEFuZ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