Changeset 6237 for trunk/Ohana/src/relphot
- Timestamp:
- Jan 29, 2006, 8:57:11 AM (20 years ago)
- Location:
- trunk/Ohana/src/relphot/src
- Files:
-
- 3 edited
-
image-db.c (modified) (1 diff)
-
load_images.c (modified) (1 diff)
-
relphot.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relphot/src/image-db.c
r4864 r6237 1 1 # include "relphot.h" 2 2 3 void lock_image_db (FITS_DB *db, char *filename) {4 5 /* lock the image catalog */6 check_permissions (filename);7 8 db[0].lockstate = LCK_XCLD;9 db[0].timeout = 3600.0;10 fits_db_init (db);11 12 if (!fits_db_lock (db, filename)) {13 fprintf (stderr, "ERROR: can't lock image catalog\n");14 exit (1);15 }16 }17 18 void unlock_image_db (FITS_DB *db) {19 20 mode_t mode;21 22 fits_db_close (db);23 24 /* force permissions to 666 */25 mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;26 chmod (db[0].filename, mode);27 } -
trunk/Ohana/src/relphot/src/load_images.c
r4864 r6237 8 8 int *Line; 9 9 int Nimage; 10 11 if (db[0].dbstate == LCK_EMPTY) Shutdown ("ERROR: No images in catalog %s (1)", db[0].filename);12 10 13 11 /* read entire db table */ -
trunk/Ohana/src/relphot/src/relphot.c
r5448 r6237 4 4 int main (int argc, char **argv) { 5 5 6 int i, Ncatalog;6 int i, status, Ncatalog; 7 7 Catalog *catalog; 8 8 GSCRegion fullregion, *region; … … 13 13 14 14 set_db (&db); 15 lock_image_db (&db, ImageCat); 15 status = dvo_image_lock (&db, ImageCat, 60.0, (UPDATE ? LCK_XCLD : LCK_SOFT)); 16 if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename); 17 if (db.dbstate == LCK_EMPTY) Shutdown ("ERROR: No images in catalog %s (1)", db.filename); 18 if (!UPDATE) dvo_image_unlock (&db); 16 19 17 20 /* load regions and images based on seed region */ … … 86 89 setMcalFinal (); 87 90 dvo_image_update (&db, VERBOSE); 88 unlock_image_db(&db);91 dvo_image_unlock (&db); 89 92 90 93 exit (0);
Note:
See TracChangeset
for help on using the changeset viewer.
