Changeset 7402
- Timestamp:
- Jun 7, 2006, 8:36:22 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/relphot/src/reload_catalogs.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relphot/src/reload_catalogs.c
r7080 r7402 4 4 5 5 int i; 6 int status; 7 struct stat filestat; 6 8 Catalog catalog; 7 9 … … 11 13 for (i = 0; i < skylist[0].Nregions; i++) { 12 14 catalog.filename = skylist[0].filename[i]; 15 16 // XXX only update existing db tables 17 status = stat (catalog.filename, &filestat); 18 if ((status == -1) && (errno == ENOENT)) { 19 if (VERBOSE) fprintf (stderr, "no file %s, skipping\n", catalog.filename); 20 continue; 21 } 13 22 switch (lock_catalog (&catalog, LCK_XCLD)) { 14 case 0: 15 fprintf (stderr, "ERROR: can't lock file %s\n", catalog.filename); 16 exit (1); 17 case 1: 18 gcatalog (&catalog, TRUE); /* load from disk */ 19 break; 20 case 2: 21 if (VERBOSE) fprintf (stderr, "no data in %s, skipping\n", catalog.filename); 22 unlock_catalog (&catalog); 23 continue; 24 break; 25 default: 26 fprintf (stderr, "weird lock_catalog exit state\n"); 27 exit (1); 23 case 0: // file cannot be locked 24 fprintf (stderr, "ERROR: can't lock file %s\n", catalog.filename); 25 exit (1); 26 case 1: // file is now locked 27 gcatalog (&catalog, TRUE); /* load from disk */ 28 break; 29 case 2: // file is empty 30 if (VERBOSE) fprintf (stderr, "no data in file %s, skipping\n", catalog.filename); 31 unlock_catalog (&catalog); 32 continue; 33 default: 34 fprintf (stderr, "weird lock_catalog exit state %s\n", catalog.filename); 35 exit (1); 28 36 } 29 37 initImageBins (&catalog, 1);
Note:
See TracChangeset
for help on using the changeset viewer.
