Ignore:
Timestamp:
09/03/15 17:12:53 (9 years ago)
Author:
sdipsl
Message:
  • catch the status of the stat command. It led to silent failure when the filesystem suffers some glitch. See #264
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh

    r1204 r1234  
    700700 
    701701  typeset NB_ESSAI DELAI status i exist skip 
     702  typeset fileDeviceNumberInHex directoryDeviceNumberInHex 
    702703 
    703704  # number of tentative 
     
    738739      i=0 
    739740      while [ $i -lt $NB_ESSAI ] ; do 
    740         if [ $( stat -c %d $1 ) -ne $( stat -c %d $( dirname $2 ) ) ] ; then 
    741           # USUAL WAY 
     741        # Identify file system 
     742        fileDeviceNumberInHex=$( stat -c %d $1 ) 
     743        status=$? 
     744        if [ ${status} -gt 0 ] ; then 
     745          IGCM_debug_Exit "IGCM_sys_PutBuffer_Out" 
     746        fi 
     747        # Identify file system 
     748        directoryDeviceNumberInHex=$( stat -c %d $( dirname $2 ) ) 
     749        status=$? 
     750        if [ ${status} -gt 0 ] ; then 
     751          IGCM_debug_Exit "IGCM_sys_PutBuffer_Out" 
     752        fi 
     753 
     754        if [ ${fileDeviceNumberInHex} -ne ${directoryDeviceNumberInHex} ] ; then 
     755          # They are not on the same device. USUAL WAY 
    742756          \cp $1 $2 > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1 
    743757          status=$? 
    744758        else 
    745           # NOT SO USUAL WAY 
     759          # They are on the same device. USUAL WAY 
    746760          \mv $1 $2 > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1 
    747761          status=$? 
Note: See TracChangeset for help on using the changeset viewer.