|
@ -556,11 +556,8 @@ static Handle<Value> Write(const Arguments& args) { |
|
|
return Undefined(); |
|
|
return Undefined(); |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
if (pos < 0) { |
|
|
written = pos < 0 ? write(fd, buf, len) : pwrite(fd, buf, len, pos); |
|
|
written = write(fd, buf, len); |
|
|
delete [] reinterpret_cast<char*>(buf); |
|
|
} else { |
|
|
|
|
|
written = pwrite(fd, buf, len, pos); |
|
|
|
|
|
} |
|
|
|
|
|
if (written < 0) return ThrowException(ErrnoException(errno)); |
|
|
if (written < 0) return ThrowException(ErrnoException(errno)); |
|
|
return scope.Close(Integer::New(written)); |
|
|
return scope.Close(Integer::New(written)); |
|
|
} |
|
|
} |
|
|