src/windows/native/java/io/io_util_md.c

Print this page

        

*** 476,486 **** if (SetEndOfFile(h) == FALSE) return -1; return 0; } JNIEXPORT ! size_t handleRead(jlong fd, void *buf, jint len) { DWORD read = 0; BOOL result = 0; HANDLE h = (HANDLE)fd; --- 476,486 ---- if (SetEndOfFile(h) == FALSE) return -1; return 0; } JNIEXPORT ! jint handleRead(jlong fd, void *buf, jint len) { DWORD read = 0; BOOL result = 0; HANDLE h = (HANDLE)fd;
*** 497,510 **** if (error == ERROR_BROKEN_PIPE) { return 0; /* EOF */ } return -1; } ! return read; } ! static size_t writeInternal(jlong fd, const void *buf, jint len, jboolean append) { BOOL result = 0; DWORD written = 0; HANDLE h = (HANDLE)fd; if (h != INVALID_HANDLE_VALUE) { --- 497,510 ---- if (error == ERROR_BROKEN_PIPE) { return 0; /* EOF */ } return -1; } ! return (jint)read; } ! static jint writeInternal(jlong fd, const void *buf, jint len, jboolean append) { BOOL result = 0; DWORD written = 0; HANDLE h = (HANDLE)fd; if (h != INVALID_HANDLE_VALUE) {
*** 525,544 **** lpOv); /* overlapped struct */ } if ((h == INVALID_HANDLE_VALUE) || (result == 0)) { return -1; } ! return (size_t)written; } JNIEXPORT ! size_t handleWrite(jlong fd, const void *buf, jint len) { return writeInternal(fd, buf, len, JNI_FALSE); } JNIEXPORT ! size_t handleAppend(jlong fd, const void *buf, jint len) { return writeInternal(fd, buf, len, JNI_TRUE); } jint handleClose(JNIEnv *env, jobject this, jfieldID fid) --- 525,544 ---- lpOv); /* overlapped struct */ } if ((h == INVALID_HANDLE_VALUE) || (result == 0)) { return -1; } ! return (jint)written; } JNIEXPORT ! jint handleWrite(jlong fd, const void *buf, jint len) { return writeInternal(fd, buf, len, JNI_FALSE); } JNIEXPORT ! jint handleAppend(jlong fd, const void *buf, jint len) { return writeInternal(fd, buf, len, JNI_TRUE); } jint handleClose(JNIEnv *env, jobject this, jfieldID fid)