IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38621


Ignore:
Timestamp:
Jul 22, 2015, 6:04:34 PM (11 years ago)
Author:
eugene
Message:

protect the catalog I/O layer from signals which can be blocked (ie, allow kill to kill gracefully)

Location:
branches/eam_branches/ipp-20150625/Ohana/src/relphot/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150625/Ohana/src/relphot/src/Shutdown.c

    r37037 r38621  
    2121  va_end (argp);
    2222
    23   SetProtect (TRUE);
    24   if (db) gfits_db_close (db);
    2523  fprintf (stderr, "ERROR: relphot halted\n");
    2624  exit (1);
  • branches/eam_branches/ipp-20150625/Ohana/src/relphot/src/reload_catalogs.c

    r38471 r38621  
    105105    free (moddate);
    106106
    107     dvo_catalog_save (&catalog, VERBOSE);
    108     dvo_catalog_unlock (&catalog);
     107    SetProtect (TRUE);
     108    if (!dvo_catalog_save (&catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog.filename); exit (1); }
     109    if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); }
     110    SetProtect (FALSE);
    109111
    110112    free_tiny_values(&catalog);
  • branches/eam_branches/ipp-20150625/Ohana/src/relphot/src/relphot.c

    r38062 r38621  
    44
    55  // get configuration info, args
     6  SetSignals ();
    67  RelphotMode mode = initialize (argc, argv);
    78  if (!mode) exit (2);
  • branches/eam_branches/ipp-20150625/Ohana/src/relphot/src/relphot_client.c

    r38062 r38621  
    1818
    1919  // get configuration info, args, lockfile (set CATDIR, HOST_ID, HOSTDIR, etc)
     20  SetSignals ();
    2021  initialize_client (argc, argv);
    2122  client_logger_init (HOSTDIR);
  • branches/eam_branches/ipp-20150625/Ohana/src/relphot/src/relphot_objects.c

    r38471 r38621  
    101101    // but it would be better to define a dvo crawler program to do this
    102102    // catalog.catformat = DVO_FORMAT_PS1_V1; 
    103     dvo_catalog_save (&catalog, VERBOSE);
    104     dvo_catalog_unlock (&catalog);
     103    SetProtect (TRUE);
     104    if (!dvo_catalog_save (&catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog.filename); exit (1); }
     105    if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); }
     106    SetProtect (FALSE);
    105107    free_tiny_values(&catalog);
    106108    dvo_catalog_free (&catalog);
  • branches/eam_branches/ipp-20150625/Ohana/src/relphot/src/relphot_synthphot.c

    r38471 r38621  
    7171    // but it would be better to define a dvo crawler program to do this
    7272    // catalog.catformat = DVO_FORMAT_PS1_V1; 
    73     dvo_catalog_save (&catalog, VERBOSE);
    74     dvo_catalog_unlock (&catalog);
     73    SetProtect (TRUE);
     74    if (!dvo_catalog_save (&catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog.filename); exit (1); }
     75    if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); }
     76    SetProtect (FALSE);
    7577    dvo_catalog_free (&catalog);
    7678  }
Note: See TracChangeset for help on using the changeset viewer.