]> git.lizzy.rs Git - dragonblocks_alpha.git/commitdiff
Fix problems with release build
authorElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 13 Feb 2022 10:39:27 +0000 (11:39 +0100)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 13 Feb 2022 10:39:27 +0000 (11:39 +0100)
.gitignore
snapshot.sh
src/client/client.c
src/client/client_auth.c
src/client/client_auth.h

index 652ffa057bf5ceb0df7689dccf26d0941dc09fd5..00abea63c19506f1bacd45f1c7b68fd3395fc03b 100644 (file)
@@ -15,6 +15,7 @@ _deps
 Dragonblocks
 DragonblocksServer
 DragonblocksAlpha-*.zip
+DragonblocksAlpha
 
 # Data
 client.conf
index c0a7976e1448ddc811f8025f3c7aa27221a8f445..f03ceed2d3d602307eff5c5de688232c2e205484 100755 (executable)
@@ -4,7 +4,7 @@ cp -r * .build/
 cd .build/
 mkdir build
 cd build
-if ! (cmake -B . -S ../src -DCMAKE_BUILD_TYPE=Release -DRESSOURCE_PATH="" && make clean && make -j$(nproc)); then
+if ! (cmake -B . -S ../src -DCMAKE_BUILD_TYPE=Release -DRESSOURCE_PATH="\"\"" && make clean && make -j$(nproc)); then
        cd ../..
        rm -rf .build
        exit 1
index 88bcded37fa0c1c923b0f5308fb83c14c047601f..80af198a78d513a043143bfe7e589764e5399495 100644 (file)
 
 DragonnetPeer *client;
 
-static bool finished = false;
+static volatile bool finished = false;
 
 static bool on_recv(unused DragonnetPeer *peer, DragonnetTypeId type, unused void *pkt)
 {
        while (client_auth.state == AUTH_INIT)
-               ;
+               sched_yield();
 
        return (client_auth.state == AUTH_WAIT) == (type == DRAGONNET_TYPE_ToClientAuth);
 }
@@ -29,8 +29,9 @@ static bool on_recv(unused DragonnetPeer *peer, DragonnetTypeId type, unused voi
 static void on_disconnect(unused DragonnetPeer *peer)
 {
        interrupted = true;
+
        while (! finished)
-               ;
+               sched_yield();
 }
 
 static void on_ToClientAuth(unused DragonnetPeer *peer, ToClientAuth *pkt)
index d78d9928e33cd5e5c01a84cfc89afb5c5ce5baa7..1e76d319787201626f9e616d93c1a3dd787fa518 100644 (file)
@@ -6,7 +6,7 @@
 #include "signal_handlers.h"
 #include "types.h"
 
-struct ClientAuth client_auth;
+volatile struct ClientAuth client_auth;
 
 static bool name_prompt()
 {
index ba1494282bd6c3ebf5ffcbe546cc142e7a2d8cdf..4d30ca0a28c299a02f141b1aceacbb9e2f2062cb 100644 (file)
@@ -8,7 +8,7 @@ typedef enum
        AUTH_SUCCESS,
 } ClientAuthState;
 
-extern struct ClientAuth
+extern volatile struct ClientAuth
 {
        char *name;
        ClientAuthState state;