213 gdata->log_flags = 0;
214
215 /* Just return if not doing logging */
216 if ( filename==NULL || flags==0 )
217 return;
218
219 /* Create potential filename for logging */
220 processPid = GETPID();
221 (void)snprintf(logging_filename, sizeof(logging_filename),
222 "%s.%d", filename, (int)processPid);
223
224 /* Turn on logging (do this last) */
225 logging = 1;
226 gdata->log_flags = flags;
227
228 #endif
229 }
230
231 /* Finish up logging, flush output to the logfile. */
232 void
233 finish_logging(int exit_code)
234 {
235 #ifdef JDWP_LOGGING
236 MUTEX_LOCK(my_mutex);
237 if ( logging ) {
238 logging = 0;
239 if ( log_file != NULL ) {
240 (void)fflush(log_file);
241 (void)fclose(log_file);
242 log_file = NULL;
243 }
244 }
245 MUTEX_UNLOCK(my_mutex);
246 #endif
247 }
|
213 gdata->log_flags = 0;
214
215 /* Just return if not doing logging */
216 if ( filename==NULL || flags==0 )
217 return;
218
219 /* Create potential filename for logging */
220 processPid = GETPID();
221 (void)snprintf(logging_filename, sizeof(logging_filename),
222 "%s.%d", filename, (int)processPid);
223
224 /* Turn on logging (do this last) */
225 logging = 1;
226 gdata->log_flags = flags;
227
228 #endif
229 }
230
231 /* Finish up logging, flush output to the logfile. */
232 void
233 finish_logging()
234 {
235 #ifdef JDWP_LOGGING
236 MUTEX_LOCK(my_mutex);
237 if ( logging ) {
238 logging = 0;
239 if ( log_file != NULL ) {
240 (void)fflush(log_file);
241 (void)fclose(log_file);
242 log_file = NULL;
243 }
244 }
245 MUTEX_UNLOCK(my_mutex);
246 #endif
247 }
|