This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Repost: lock/unlock filechannel Win32 implementation (patch file)


Hi Michele,

If you:

- fix the layout as Andrew mentioned
- change this:

+        DWORD errnum = GetLastError();
+        LPTSTR perrmsg = NULL;
+
+        if(FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+            FORMAT_MESSAGE_FROM_SYSTEM,0,errnum,0,(LPTSTR)&perrmsg,0,NULL))
+        {
+            jstring jerrstr= JvNewStringLatin1(perrmsg);
+            LocalFree(perrmsg);
+            throw new IOException(jerrstr);
+        }
+        else
+            throw new IOException(JvNewStringLatin1("UnlockFileEx() failed!"));

...to this (in both lock() and unlock()):

_Jv_ThrowIOException(GetLastError())

..then I'll apply this to 4.2 and apply it (if Tom says it's okay) if it passes
a couple of simple tests. Thanks in advance.

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]