common.c revision 1878
961N/A* The contents of this file are subject to the terms of the 961N/A* Common Development and Distribution License, Version 1.0 only 961N/A* (the "License"). You may not use this file except in compliance 961N/A* You can obtain a copy of the license at 961N/A* See the License for the specific language governing permissions 961N/A* and limitations under the License. 961N/A* When distributing Covered Code, include this CDDL HEADER in each 961N/A* file and include the License file at 961N/A* add the following below this CDDL HEADER, with the fields enclosed 961N/A* by brackets "[]" replaced with your own identifying * information: 961N/A* Portions Copyright [yyyy] [name of copyright owner] 961N/A* Portions Copyright 2007 Sun Microsystems, Inc. 961N/A// ---------------------------------------------------- 961N/A// Function used to create a process with the given command. 961N/A// The information about the process is stored in procInfo. 961N/A// The function returns TRUE if the process could be created 961N/A// ---------------------------------------------------- 961N/A // reset process info first 961N/A // initialize handles to pass to the child process 961N/A // Create the child process 961N/A// ---------------------------------------------------- 961N/A// Function used to launch a process for the given command 961N/A// If the process could be created it returns the pid of 961N/A// the created process and -1 otherwise. 961N/A// ---------------------------------------------------- 1298N/A// --------------------------------------------------- 1298N/A// --------------------------------------------------- 1298N/A // The file containing the log. 1878N/A debug(
"--------------- FIRST LOG MESSAGE FROM '%s' ---------------",
1298N/A // It would be nice to echo to stderr, but that doesn't appear to work. 1298N/A// --------------------------------------------------------------- 1298N/A// Get the fully-qualified debug log file name. The logic in this 1298N/A// method assumes that the executable of this process is in a 1298N/A// direct subdirectory of the instance root. 1298N/A// --------------------------------------------------------------- 1298N/A // Get the name of the executable. 1878N/A // Cut everything after the last slash, twice. This will take us back to the 1298N/A // This logic assumes that we are in a directory above the instance root. 1298N/A// --------------------------------------------------------------- 1298N/A// Function called to know if the --debug option was passed 1298N/A// when calling this executable or not. The DEBUG variable is 1298N/A// --------------------------------------------------------------- 1298N/A// --------------------------------------------------------------- 1298N/A// Deletes a file if it's larger than the given maximum size. 1298N/A// ---------------------------------------------------------------