• src/xpdev/filewrap.c

    From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Sunday, November 10, 2024 22:12:10
    https://gitlab.synchro.net/main/sbbs/-/commit/09f98728aecf1e7049d04168
    Modified Files:
    src/xpdev/filewrap.c
    Log Message:
    Get rid of the fcntl() usage in sopen()

    You can't lock a file on a Samba share via both fcntl() and flock() (the interact/collide).

    This code was in a !BSD block which means they guy that wrote/committed
    it wasn't using it either.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Sunday, November 10, 2024 23:52:50
    https://gitlab.synchro.net/main/sbbs/-/commit/043feff892a3a206ed12e9cf
    Modified Files:
    src/xpdev/filewrap.c
    Log Message:
    Log a build warning if building for Linux without OFD lock support

    OFD locks are needed on Linux for appropriate multi-threaded shared file
    access (using fcntl record locks to prevent corruption), so log a warning if building for Linux without that support.

    lock() now mimics DOS/Windows again: the result lock is an "all access" lock regardless of what mode the file was open in. I'm not sure why this change was made (commit 11b73134563ce26), but I don't think it was necessary or appropriate (though I can't think of any immediate negative effects). At minimum it makes the code a little more understandable and eliminates an
    extra call to fcntl().

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Monday, November 11, 2024 01:13:16
    https://gitlab.synchro.net/main/sbbs/-/commit/d9d86d6a36f9133ed5b08189
    Modified Files:
    src/xpdev/filewrap.c
    Log Message:
    Revert the lock() change in commit 043feff8

    So this change is needed or else fcntl() will fail with errno=BADF if trying
    to write-lock a file that was opened read-only. Oh well. Added a comment explaining the rationale.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net