You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2017/03/16 15:46:34 UTC

incubator-mynewt-newt git commit: MYNEWT-674 newt - Remove use of new io.SeekCurrent

Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop f753f2bba -> eee86aafb


MYNEWT-674 newt - Remove use of new io.SeekCurrent

This constant was added in go 1.7. A lot of package manager repos only
carry go 1.6, so the use of this constant makes newt unbuildable for a
lot of users.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/eee86aaf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/eee86aaf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/eee86aaf

Branch: refs/heads/develop
Commit: eee86aafbd9932dd80ba84d4f2ecfc4179b0ca8c
Parents: f753f2b
Author: Christopher Collins <cc...@apache.org>
Authored: Thu Mar 16 08:47:33 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Thu Mar 16 08:47:47 2017 -0700

----------------------------------------------------------------------
 newt/image/image.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/eee86aaf/newt/image/image.go
----------------------------------------------------------------------
diff --git a/newt/image/image.go b/newt/image/image.go
index dd09b16..8e33273 100644
--- a/newt/image/image.go
+++ b/newt/image/image.go
@@ -611,7 +611,8 @@ func (image *Image) Generate(loader *Image) error {
 		"Computed Hash for image %s as %s \n",
 		image.TargetImg, hex.EncodeToString(image.Hash))
 
-	sz, err := imgFile.Seek(0, io.SeekCurrent)
+	// XXX: Replace "1" with io.SeekCurrent when go 1.7 becomes mainstream.
+	sz, err := imgFile.Seek(0, 1)
 	if err != nil {
 		return util.FmtNewtError("Failed to calculate file size of generated "+
 			"image %s: %s", image.TargetImg, err.Error())