Merge

Sat, 26 Mar 2011 08:31:45 -0700

author
roland
date
Sat, 26 Mar 2011 08:31:45 -0700
changeset 2684
244bf8afbbd3
parent 2683
7e88bdae86ec
parent 2682
29524004ce17
child 2685
1927db75dd85

Merge

     1.1 --- a/src/share/vm/utilities/ostream.cpp	Fri Mar 25 09:35:39 2011 +0100
     1.2 +++ b/src/share/vm/utilities/ostream.cpp	Sat Mar 26 08:31:45 2011 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -424,6 +424,15 @@
    1.11  
    1.12    const char* star = strchr(basename, '*');
    1.13    int star_pos = (star == NULL) ? -1 : (star - nametail);
    1.14 +  int skip = 1;
    1.15 +  if (star == NULL) {
    1.16 +    // Try %p
    1.17 +    star = strstr(basename, "%p");
    1.18 +    if (star != NULL) {
    1.19 +      skip = 2;
    1.20 +    }
    1.21 +  }
    1.22 +  star_pos = (star == NULL) ? -1 : (star - nametail);
    1.23  
    1.24    char pid[32];
    1.25    if (star_pos >= 0) {
    1.26 @@ -442,11 +451,11 @@
    1.27    }
    1.28  
    1.29    if (star_pos >= 0) {
    1.30 -    // convert foo*bar.log to foo123bar.log
    1.31 +    // convert foo*bar.log or foo%pbar.log to foo123bar.log
    1.32      int buf_pos = (int) strlen(buf);
    1.33      strncpy(&buf[buf_pos], nametail, star_pos);
    1.34      strcpy(&buf[buf_pos + star_pos], pid);
    1.35 -    nametail += star_pos + 1;  // skip prefix and star
    1.36 +    nametail += star_pos + skip;  // skip prefix and pid format
    1.37    }
    1.38  
    1.39    strcat(buf, nametail);      // append rest of name, or all of name
    1.40 @@ -466,7 +475,7 @@
    1.41      // Note:  This feature is for maintainer use only.  No need for L10N.
    1.42      jio_print(warnbuf);
    1.43      FREE_C_HEAP_ARRAY(char, try_name);
    1.44 -    try_name = make_log_name("hs_pid*.log", os::get_temp_directory());
    1.45 +    try_name = make_log_name("hs_pid%p.log", os::get_temp_directory());
    1.46      jio_snprintf(warnbuf, sizeof(warnbuf),
    1.47                   "Warning:  Forcing option -XX:LogFile=%s\n", try_name);
    1.48      jio_print(warnbuf);

mercurial