Progress
External Program
Interfaces


Handling Abnormal Exits

In character mode, if you abort to the operating system during application testing, or otherwise must abort from your production version, make sure your HLC application does not terminate with raw terminal I/O. Set the terminal to cooked terminal I/O before exiting. This prepares the terminal for UNIX operation, as shown in the following example:

/*
 * Example of a fatal error exit for an HLC application.
 * 
 * Note how the terminal is returned to cooked mode before
 * exiting. Note also that exiting in this fashion can be
 * hazardous to your database. (This function should only
 * occur in program development phase for convenience in the
 * debugging process.)
 */

void hl_fexit (code)
{
  proscopn(); /* restore terminal to cooked mode */
  exit (1);
} 

CAUTION: An abnormal exit function might be useful during testing, but you should never include it in a production executable. Since it bypasses Progress shutdown processing, this function can cause irrecoverable database damage.

Progress automatically restores cooked-mode terminal I/O before exiting. If your application aborts in raw mode, the user can enter commands but might not see the result.

Follow these steps to reset a character-mode terminal in raw mode at a UNIX shell prompt:

  1. Press CONTROL-J several times. Shell prompts appear on the display.
  2. If the stty command on your version of UNIX has a sane option, enter the following command, followed by CONTROL-J:
  3. stty sane 
    

    If your stty command does not have a sane option, enter the following command, followed by CONTROL-J:

    stty echo icanon icrnl opost 
    


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095