Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: EXP12 compliance

...

Code Block
bgColor#FFcccc
#include <stdio.h>
#include <stdlib.h>

void exit1(void) {
  /* ...cleanup code... */
  return;
}

void exit2(void) {
  if (/* condition */) {
    /* ...more cleanup code... */
    exit(0);
  }
  return;
}

int main(void) {
  if (atexit(exit1);
  atexit(exit2); != 0) {
    /* Handle Error */
  }
  if (atexit(exit2) != 0) {
    /* Handle Error */
  }
  /* ...program code... */
  exit(0);
}

...

Code Block
bgColor#ccccFF
#include <stdio.h>
#include <stdlib.h>

void exit1(void) {
  /* ...cleanup code... */
  return;
}

void exit2(void) {
  if (/* condition */) {
    /* ...more cleanup code... */
  }
  return;
}

int main(void) {
  if (atexit(exit1);
  atexit(exit2); != 0) {
    /* Handle Error */
  }
  if (atexit(exit2) != 0) {
    /* Handle Error */
  }
  /* ...program code... */
  exit(0);
}

...