aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2011-12-02 18:02:50 +0100
committerBjörn Gustavsson <[email protected]>2011-12-07 17:40:14 +0100
commitc4f3d1354284310f18f3f6d5b3782c64e06fdea1 (patch)
tree8345f814aa8bb6d11a5f74c1c26f81a145fa2c83 /erts/emulator/sys
parent6b31de5969abeb37f7d8d43815a236abadb42508 (diff)
downloadotp-c4f3d1354284310f18f3f6d5b3782c64e06fdea1.tar.gz
otp-c4f3d1354284310f18f3f6d5b3782c64e06fdea1.tar.bz2
otp-c4f3d1354284310f18f3f6d5b3782c64e06fdea1.zip
erl_driver.h: Use ErlDrvSizeT for size field in ErlIOVec
Diffstat (limited to 'erts/emulator/sys')
-rw-r--r--erts/emulator/sys/unix/sys.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c
index 52477467b3..fffdfc8a53 100644
--- a/erts/emulator/sys/unix/sys.c
+++ b/erts/emulator/sys/unix/sys.c
@@ -2002,17 +2002,19 @@ static void outputv(ErlDrvData e, ErlIOVec* ev)
int pb = driver_data[fd].packet_bytes;
int ofd = driver_data[fd].ofd;
int n;
- int sz;
+ ErlDrvSizeT sz;
char lb[4];
char* lbp;
- int len = ev->size;
+ ErlDrvSizeT len = ev->size;
/* (len > ((unsigned long)-1 >> (4-pb)*8)) */
+ /* if (pb >= 0 && (len & (((ErlDrvSizeT)1 << (pb*8))) - 1) != len) {*/
if (((pb == 2) && (len > 0xffff)) || (pb == 1 && len > 0xff)) {
driver_failure_posix(ix, EINVAL);
return; /* -1; */
}
- put_int32(len, lb);
+ /* Handles 0 <= pb <= 4 only */
+ put_int32((Uint32) len, lb);
lbp = lb + (4-pb);
ev->iov[0].iov_base = lbp;