changeset 9533:7a648a0403ba

8037274: sun.tools.attach.WindowsVirtualMachine#createPipe() needs more descriptive message when pipe creation fails Reviewed-by: alanb, dcubed, allwin
author jbachorik
date Mon, 24 Mar 2014 13:16:25 +0100
parents 15b7d6a7c643
children 249bbb2b67e4
files src/windows/native/sun/tools/attach/WindowsVirtualMachine.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/sun/tools/attach/WindowsVirtualMachine.c	Mon Mar 24 14:14:03 2014 +0400
+++ b/src/windows/native/sun/tools/attach/WindowsVirtualMachine.c	Mon Mar 24 13:16:25 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -273,7 +273,9 @@
           NULL);                        // default security attribute
 
     if (hPipe == INVALID_HANDLE_VALUE) {
-        JNU_ThrowIOExceptionWithLastError(env, "CreateNamedPipe failed");
+        char msg[256];
+        _snprintf(msg, sizeof(msg), "CreateNamedPipe failed: %d", GetLastError());
+        JNU_ThrowIOExceptionWithLastError(env, msg);
     }
     return (jlong)hPipe;
 }