comparison src/os/solaris/vm/os_solaris.cpp @ 4082:36b057451829

7110017: is_headless_jre should be updated to reflect the new location of awt toolkit libraries Reviewed-by: dholmes, dsamersoff Contributed-by: Chris Hegarty <chris.hegarty@oracle.com>
author dholmes
date Wed, 16 Nov 2011 20:38:24 -0500
parents 436b4a3231bf
children e7dead7e90af 11c26bfcf8c7
comparison
equal deleted inserted replaced
4067:f9a80a035a4a 4082:36b057451829
6309 } 6309 }
6310 } 6310 }
6311 6311
6312 // is_headless_jre() 6312 // is_headless_jre()
6313 // 6313 //
6314 // Test for the existence of libmawt in motif21 or xawt directories 6314 // Test for the existence of xawt/libmawt.so or libawt_xawt.so
6315 // in order to report if we are running in a headless jre 6315 // in order to report if we are running in a headless jre
6316 //
6317 // Since JDK8 xawt/libmawt.so was moved into the same directory
6318 // as libawt.so, and renamed libawt_xawt.so
6316 // 6319 //
6317 bool os::is_headless_jre() { 6320 bool os::is_headless_jre() {
6318 struct stat statbuf; 6321 struct stat statbuf;
6319 char buf[MAXPATHLEN]; 6322 char buf[MAXPATHLEN];
6320 char libmawtpath[MAXPATHLEN]; 6323 char libmawtpath[MAXPATHLEN];
6321 const char *xawtstr = "/xawt/libmawt.so"; 6324 const char *xawtstr = "/xawt/libmawt.so";
6322 const char *motifstr = "/motif21/libmawt.so"; 6325 const char *new_xawtstr = "/libawt_xawt.so";
6323 char *p; 6326 char *p;
6324 6327
6325 // Get path to libjvm.so 6328 // Get path to libjvm.so
6326 os::jvm_path(buf, sizeof(buf)); 6329 os::jvm_path(buf, sizeof(buf));
6327 6330
6338 // check xawt/libmawt.so 6341 // check xawt/libmawt.so
6339 strcpy(libmawtpath, buf); 6342 strcpy(libmawtpath, buf);
6340 strcat(libmawtpath, xawtstr); 6343 strcat(libmawtpath, xawtstr);
6341 if (::stat(libmawtpath, &statbuf) == 0) return false; 6344 if (::stat(libmawtpath, &statbuf) == 0) return false;
6342 6345
6343 // check motif21/libmawt.so 6346 // check libawt_xawt.so
6344 strcpy(libmawtpath, buf); 6347 strcpy(libmawtpath, buf);
6345 strcat(libmawtpath, motifstr); 6348 strcat(libmawtpath, new_xawtstr);
6346 if (::stat(libmawtpath, &statbuf) == 0) return false; 6349 if (::stat(libmawtpath, &statbuf) == 0) return false;
6347 6350
6348 return true; 6351 return true;
6349 } 6352 }
6350 6353