dfu-util pull request
stefan at datenfreihafen.org
Sun Apr 22 15:41:21 CEST 2012
On Sun, 2012-04-22 at 11:50, Tormod Volden wrote:
> On Sun, Apr 22, 2012 at 11:02 AM, Tormod Volden wrote:
> > On Sun, Apr 22, 2012 at 12:07 AM, Tormod Volden wrote:
> >> On Sat, Apr 21, 2012 at 11:01 PM, Stefan Schmidt wrote:
> >>>> dfu-suffix: Check for availability of truncate() function
> >>> You happen to know which platforms are missing this?
> >> No, but I would guess everything non-posix. I believe, unless you are
> >> using cygwin, the posix layer on Windows is not so complete. I know
> >> that when compiling with MinGW, truncate() is not available. I just
> >> found this http://stackoverflow.com/questions/584639/truncate-file so
> >> it looks like we can use SetEndOfFile() on Windows instead. I will
> >> look into that another day.
> > I found ftruncate() on MinGW, so I changed to use that (with help of
> > fileno() to avoid reopening the file this got much cleaner too). For
> > non-MinGW Windows, it seems like _chsize_s is an equivalent (forget
> > about SetEndOfFile() which acts on Windows file handles). Since I can
> > not test that variant, and MinGW works fine, I am not including it.
> BTW, I squashed this commit into the "porting to stdio" commit, since
> it ended up as a small change, and even more so combined (it was
> originally using ftruncate, so otherwise it would be a lot of back and
> forth between commits).
Great, works fine here as well.
> >> We could maybe wait to see if I can get suffix truncation work on
> >> Windows easily, that would save some documentation and make dfu-util
> >> fully consistent across architectures.
> > Should be fine now.
> Tested and works fine on Windows 7.
Cool. I pulled it in, did a changelog, tagged it and now I'm in the
final testing before I push it all out (ETA 30min). I will wait with the
announcement for you to prepare the windows executable from either the
git tag or the release tarball. Docs about building for windows would
be a nice bonus, but for the release I only would like the windows
binary. Please include the version in the filename and also prepare a
.md5 file with the checksum. This way it can go straight to the
release folder with the tarball. Obviously take your time for this.
The final announcement can wait a day or two if you have more
important or better stuff to do. :)
More information about the devel