IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39312 for trunk


Ignore:
Timestamp:
Jan 13, 2016, 4:35:37 PM (11 years ago)
Author:
eugene
Message:

add extra flush calls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libdvo/src/dvo_catalog_split.c

    r39308 r39312  
    109109  }
    110110  off_t fullsize = catalog->header.datasize;
     111
     112  if (fflush (catalog->f)) {
     113    perror ("fflush: ");
     114    fprintf (stderr, "failed to flush file %s\n", catalog->filename);
     115    return FALSE;
     116  }
    111117
    112118# if (1)
     
    168174      return (FALSE);
    169175    }
     176    if (fflush (catalog->f)) {
     177      perror ("fflush: ");
     178      fprintf (stderr, "failed to flush file %s\n", catalog->filename);
     179      return FALSE;
     180    }
    170181    if (!gfits_fwrite_table (catalog->f, outtable)) {
    171182      fprintf (stderr, "can't write table data\n");
     
    211222  gfits_free_header (&cmpheader);
    212223  gfits_free_table (&cmptable);
     224
     225  if (fflush (catalog->f)) {
     226    perror ("fflush: ");
     227    fprintf (stderr, "failed to flush file %s\n", catalog->filename);
     228    return FALSE;
     229  }
    213230
    214231  // if the output file will be completely re-written, truncate to total datasize
     
    275292  /* read PHU */
    276293  if (!gfits_load_header (subcat[0].f, &subcat[0].header)) {
    277     if (VERBOSE) fprintf (stderr, "error reading %s header: %s\n", name, subcat[0].filename);
     294    if (VERBOSE) fprintf (stderr, "error reading PHU %s header: %s\n", name, subcat[0].filename);
    278295    return (DVO_CAT_OPEN_FAIL);
    279296  }
     
    283300  /* read table header */
    284301  if (!gfits_fread_header (subcat[0].f, header)) {
    285     if (VERBOSE) fprintf (stderr, "can't read %s PHU header\n", name);
     302    if (VERBOSE) fprintf (stderr, "can't read %s table header\n", name);
    286303    gfits_free_header (&subcat[0].header);
    287304    return (DVO_CAT_OPEN_FAIL);
Note: See TracChangeset for help on using the changeset viewer.