changeset 23570:6b0a90ae5eaa

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 1ef5563dedda
children 2be40cc450b5
files jdk/src/windows/native/sun/tools/attach/WindowsVirtualMachine.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/windows/native/sun/tools/attach/WindowsVirtualMachine.c	Mon Mar 24 14:14:03 2014 +0400
+++ b/jdk/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;
 }