[PATCH] nvmecontrol breaks world

2013-07-02 Thread Steve Kargl
Could someone (this could even be me, but need approval) please
fix nvmecontrol?

Index: nvmecontrol/firmware.c
===
--- nvmecontrol/firmware.c  (revision 252514)
+++ nvmecontrol/firmware.c  (working copy)
@@ -82,7 +82,7 @@ read_image_file(char *path, void **buf, 
exit(EX_IOERR);
}
if ((*buf = malloc(sb.st_size)) == NULL) {
-   fprintf(stderr, Unable to malloc %zd bytes.\n,
+   fprintf(stderr, Unable to malloc %jd bytes.\n,
sb.st_size);
close(fd);
exit(EX_IOERR);
@@ -95,7 +95,7 @@ read_image_file(char *path, void **buf, 
}
if (*size != sb.st_size) {
fprintf(stderr, Error reading '%s', 
-   read %zd bytes, requested %zd bytes\n,
+   read %zd bytes, requested %jd bytes\n,
path, *size, sb.st_size);
close(fd);
exit(EX_IOERR);
-- 
Steve
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [PATCH] nvmecontrol breaks world

2013-07-02 Thread Ed Schouten
2013/7/2 Steve Kargl s...@troutmask.apl.washington.edu:
 Could someone (this could even be me, but need approval) please
 fix nvmecontrol?

off_t doesn't need to be intmax_t, right? Maybe add an explicit cast?
Also, the call of malloc(sb.st_size) is not really safe...


--
Ed Schouten e...@80386.nl
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [PATCH] nvmecontrol breaks world

2013-07-02 Thread Dimitry Andric
On Jul 2, 2013, at 22:30, Ed Schouten e...@80386.nl wrote:
 2013/7/2 Steve Kargl s...@troutmask.apl.washington.edu:
 Could someone (this could even be me, but need approval) please
 fix nvmecontrol?
 
 off_t doesn't need to be intmax_t, right? Maybe add an explicit cast?

Yes, that is what Bruce has suggested for off_t many times in the past. :-)


 Also, the call of malloc(sb.st_size) is not really safe...

Sure, but that does not break buildworld (for gcc users, I assume? the 
tinderboxes are all green).

-Dimitry

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [PATCH] nvmecontrol breaks world

2013-07-02 Thread Steve Kargl
On Tue, Jul 02, 2013 at 10:37:35PM +0200, Dimitry Andric wrote:
 On Jul 2, 2013, at 22:30, Ed Schouten e...@80386.nl wrote:
  2013/7/2 Steve Kargl s...@troutmask.apl.washington.edu:
  Could someone (this could even be me, but need approval) please
  fix nvmecontrol?
  
  off_t doesn't need to be intmax_t, right? Maybe add an explicit cast?
 
 Yes, that is what Bruce has suggested for off_t many times in the past. :-)
 
 
  Also, the call of malloc(sb.st_size) is not really safe...
 
 Sure, but that does not break buildworld (for gcc users, I assume? the 
 tinderboxes are all green).
 

A gcc-only buildworld is broken on i386 without my patch.  See

http://lists.freebsd.org/pipermail/svn-src-all/2013-July/070954.html

-- 
Steve
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [PATCH] nvmecontrol breaks world

2013-07-02 Thread Steve Kargl
On Tue, Jul 02, 2013 at 10:30:53PM +0200, Ed Schouten wrote:
 2013/7/2 Steve Kargl s...@troutmask.apl.washington.edu:
  Could someone (this could even be me, but need approval) please
  fix nvmecontrol?
 
 off_t doesn't need to be intmax_t, right? Maybe add an explicit cast?
 Also, the call of malloc(sb.st_size) is not really safe...
 

jimharris committed the patch.  I suspect that this is intel
code, which needs to be portable to other OS's.  Hopefully,
he fixes the build soon. 

-- 
Steve
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org