• src/doors/clans-src/src/door.c door.h structs.h system.c

    From Deucе@VERT to Git commit to main/sbbs/master on Sat Oct 25 09:53:33 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/7ed974a8719b7e69117f4e63
    Modified Files:
    src/doors/clans-src/src/door.c door.h structs.h system.c
    Log Message:
    Use the standard "x" flag with fopen() for online semaphore

    Also, fix the race condition inherent in the check-then-use method.
    Now, it tries to create the semaphore file using mode "w+bx" and if
    that fails, someone is online. If it succeeds, nobody is online.

    With this, I'm not sure that the _fsopen() is even needed... will
    need to go through the maint and ibbs options.

    Also, instead of a binary representation of the node number, use
    "Node: %d\n"

    Add /EXCLUSIVE option

    This option asserts that there are no other copies of the game
    running, and it is safe to remove online.flg if it exists.

    Create/test the semaphore before reading dynamic data

    Also, on node 0, wait for the semaphore rather than exit.

    So, it's expected you will set everything up line this:
    Regular door: clans /Nx /Sx /Dxxxx
    IBBS import: clans /I
    Maint: clans /M /EXCLUSIVE

    The IBBS import and Maint events need to run on the same node so that
    an import won't be running at the same time as maint. If that's not
    possible, leave off the /EXCLUSIVE option to maint, and keep an eye
    on the flag file because processes will build up waiting on the
    semfile in the case of a crash.

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