Ticket #53630: file-lock-removal.diff

File file-lock-removal.diff, 2.7 KB (added by aaschwanden (Andy Aschwanden), 8 years ago)
  • src/H5private.h

     
    812812     * fcntl(2), then fall back to a function that always fails if
    813813     * it is not present at all.
    814814     */
    815     #if defined(H5_HAVE_FLOCK)
    816         #define HDflock(F,L)    flock(F,L)
    817     #elif defined(H5_HAVE_FCNTL)
    818         #define HDflock(F,L)    Pflock(F,L)
    819     #else
    820         #define HDflock(F,L)    Nflock(F,L)
    821     #endif /* H5_HAVE_FLOCK */
     815    /* TEMPORARY SOURCE PATCH for HDF5 1.10.0-patch1
     816     *
     817     * Define the no-op function as flock to disable file
     818     * locking.
     819     */
     820    #define HDflock(F,L)    Nflock(F,L)
    822821#endif /* HDflock */
    823822#ifndef HDfloor
    824823    #define HDfloor(X)    floor(X)
  • src/H5system.c

     
    638638 * Purpose:     Wrapper function for systems where no file locking is
    639639 *              available.
    640640 *
    641  * Return:      Failure:    -1 (always fails)
     641 * Return:      Success:    1 (always passes)
    642642 *
    643643 *-------------------------------------------------------------------------
    644644 */
    645645int H5_ATTR_CONST
    646646Nflock(int H5_ATTR_UNUSED fd, int H5_ATTR_UNUSED operation) {
    647     /* just fail */
    648     return -1;
     647    /* just pass */
     648    return 1;
    649649} /* end Nflock() */
    650650
    651651
  • test/swmr.c

     
    45074507**    This is for concurrent access.
    45084508**
    45094509*****************************************************************/
    4510 #if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_FLOCK))
    45114510
    45124511static int
    45134512test_file_lock_concur(hid_t H5_ATTR_UNUSED in_fapl)
     
    45204519
    45214520} /* end test_file_lock_concur() */
    45224521
    4523 #else
     4522/* THIS TEST IS DISABLED IN THIS SOURCE PATCH
     4523 *
     4524 * The test will fail when file locking (disabled in this patch)
     4525 * is non-functional so it is simply skipped.
     4526 */
     4527#if 0
    45244528   
    45254529static int
    45264530test_file_lock_concur(hid_t in_fapl)
     
    48834887**    This is for concurrent access.
    48844888**
    48854889*****************************************************************/
    4886 #if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
    48874890
    48884891static int
    48894892test_file_lock_swmr_concur(hid_t H5_ATTR_UNUSED in_fapl)
     
    48964899
    48974900} /* end test_file_lock_swmr_concur() */
    48984901
    4899 #else
     4902/* THIS TEST IS DISABLED IN THIS SOURCE PATCH
     4903 *
     4904 * The test will fail when file locking (disabled in this patch)
     4905 * is non-functional so it is simply skipped.
     4906 */
     4907#if 0
    49004908
    49014909static int
    49024910test_file_lock_swmr_concur(hid_t in_fapl)