Skip to content

Commit fd23847

Browse files
committed
option for skipping unlock failure
1 parent 1d8418b commit fd23847

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

arch/linux_x86_uio/dma_buffer_inc.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -864,10 +864,15 @@ DMABuffer_free
864864

865865
if(munlock(buffer->map, buffer->length) != 0)
866866
{
867-
// report, but continue with release procedure even if unlock fails
868-
//ERROR_EXIT( errno, exit, "Buffer unlocking failed!\n" );
869-
ERROR( errno, "Buffer unlocking failed!\n" );
870-
}
867+
#ifdef PDA_SKIP_UNLOCK_FAILURE
868+
#pragma message "*** Compiling with PDA_SKIP_UNLOCK_FAILURE"
869+
// report, but continue with release procedure even if unlock fails
870+
ERROR( errno, "Buffer unlocking failed! (but releasing)\n" );
871+
if(0) { goto exit; } // fake use of exit label to avoid compiler warning
872+
#else
873+
ERROR_EXIT( errno, exit, "Buffer unlocking failed!\n" );
874+
#endif
875+
}
871876

872877
buffer->map = MAP_FAILED;
873878
persistant = PDA_DELETE;

0 commit comments

Comments
 (0)