IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38620


Ignore:
Timestamp:
Jul 22, 2015, 6:02:43 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/relastro/src
Files:
7 edited

Legend:

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

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

    r38441 r38620  
    270270
    271271  fprintf (stderr, "found %d matches\n", Nmatch);
    272   dvo_catalog_save (&catalogOut, VERBOSE2);
    273   dvo_catalog_unlock (&catalogOut);
     272
     273  SetProtect (TRUE);
     274  if (!dvo_catalog_save (&catalogOut, VERBOSE2)) { fprintf (stderr, "ERROR: failed to save %s\n", catalogOut.filename); exit (1); }
     275  if (!dvo_catalog_unlock (&catalogOut)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalogOut.filename); exit (1); }
     276  SetProtect (FALSE);
     277
    274278  dvo_catalog_free (&catalogOut);
    275279  free (slowMoving);
  • branches/eam_branches/ipp-20150625/Ohana/src/relastro/src/hpm_objects.c

    r38441 r38620  
    110110  if (catalog[0].Naverage == Nslow) {
    111111    fprintf (stderr, "no possible fast objects, skipping this catalog\n");
    112     dvo_catalog_save (&catalogOut, VERBOSE2);
    113     dvo_catalog_unlock (&catalogOut);
     112
     113    SetProtect (TRUE);
     114    if (!dvo_catalog_save (&catalogOut, VERBOSE2)) { fprintf (stderr, "ERROR: failed to save %s\n", catalogOut.filename); exit (1); }
     115    if (!dvo_catalog_unlock (&catalogOut)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalogOut.filename); exit (1); }
     116    SetProtect (FALSE);
     117
    114118    dvo_catalog_free (&catalogOut);
    115119    free (slowMoving);
  • branches/eam_branches/ipp-20150625/Ohana/src/relastro/src/relastro.c

    r36630 r38620  
    44
    55  /* get configuration info, args */
     6  SetSignals ();
    67  initialize (argc, argv);
    78
  • branches/eam_branches/ipp-20150625/Ohana/src/relastro/src/relastro_client.c

    r38441 r38620  
    2222
    2323  // get configuration info, args, lockfile (set CATDIR, HOST_ID, HOSTDIR, etc)
     24  SetSignals ();
    2425  initialize_client (argc, argv);
    2526
  • branches/eam_branches/ipp-20150625/Ohana/src/relastro/src/relastro_merge_source.c

    r38441 r38620  
    122122    resort_catalog (&catalog_src);
    123123
    124     dvo_catalog_save (&catalog_src, VERBOSE2);
    125     dvo_catalog_unlock (&catalog_src);
     124    SetProtect (TRUE);
     125    if (!dvo_catalog_save (&catalog_src, VERBOSE2)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog_src.filename); exit (1); }
     126    if (!dvo_catalog_unlock (&catalog_src)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog_src.filename); exit (1); }
     127    SetProtect (FALSE);
    126128    dvo_catalog_free (&catalog_src);
    127129
  • branches/eam_branches/ipp-20150625/Ohana/src/relastro/src/save_catalogs.c

    r33652 r38620  
    99
    1010    if (VERBOSE2) fprintf (stderr, "saving catalog %s\n", catalog[i].filename);
    11     dvo_catalog_save (&catalog[i], VERBOSE2);
    12     dvo_catalog_unlock (&catalog[i]);
     11    SetProtect (TRUE);
     12    if (!dvo_catalog_save (&catalog[i], VERBOSE2)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog[i].filename); exit (1); }
     13    if (!dvo_catalog_unlock (&catalog[i])) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog[i].filename); exit (1); }
     14    SetProtect (FALSE);
    1315    dvo_catalog_free (&catalog[i]);
    1416  }
Note: See TracChangeset for help on using the changeset viewer.