Skip to content

Commit

Permalink
GUACAMOLE-1846: Ensure successful builds on older GCC.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuehlner committed Aug 29, 2023
1 parent eae2428 commit efc0793
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 16 deletions.
2 changes: 0 additions & 2 deletions src/common/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ void guac_common_display_dup(
guac_common_display* display, guac_client* client,
guac_socket* socket) {

guac_client* client = user->client;

pthread_mutex_lock(&display->_lock);

/* Sunchronize shared cursor */
Expand Down
3 changes: 1 addition & 2 deletions src/guacd/daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,7 @@ int main(int argc, char* argv[]) {
}

/* Clean up and exit if SIGINT or SIGTERM signals are caught */
struct sigaction signal_stop_action = { 0 };
signal_stop_action.sa_handler = signal_stop_handler;
struct sigaction signal_stop_action = { .sa_handler = signal_stop_handler };
sigaction(SIGINT, &signal_stop_action, NULL);
sigaction(SIGTERM, &signal_stop_action, NULL);

Expand Down
3 changes: 1 addition & 2 deletions src/guacd/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,7 @@ static void guacd_exec_proc(guacd_proc* proc, const char* protocol) {
guacd_proc_self = proc;

/* Clean up and exit if SIGINT or SIGTERM signals are caught */
struct sigaction signal_stop_action = { 0 };
signal_stop_action.sa_handler = signal_stop_handler;
struct sigaction signal_stop_action = { .sa_handler = signal_stop_handler };
sigaction(SIGINT, &signal_stop_action, NULL);
sigaction(SIGTERM, &signal_stop_action, NULL);

Expand Down
2 changes: 1 addition & 1 deletion src/libguac/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ libguacinc_HEADERS = \
guacamole/protocol-constants.h \
guacamole/protocol-types.h \
guacamole/recording.h \
guacamole/reentrant-rwlock.h \
guacamole/socket-constants.h \
guacamole/socket.h \
guacamole/socket-fntypes.h \
Expand All @@ -82,7 +83,6 @@ noinst_HEADERS = \
id.h \
encode-jpeg.h \
encode-png.h \
reentrant-rwlock.h \
palette.h \
user-handlers.h \
raw_encoder.h \
Expand Down
14 changes: 7 additions & 7 deletions src/libguac/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
#include "guacamole/plugin.h"
#include "guacamole/pool.h"
#include "guacamole/protocol.h"
#include "guacamole/reentrant-rwlock.h"
#include "guacamole/socket.h"
#include "guacamole/stream.h"
#include "guacamole/string.h"
#include "guacamole/timestamp.h"
#include "guacamole/user.h"
#include "id.h"
#include "reentrant-rwlock.h"

#include <dlfcn.h>
#include <errno.h>
Expand Down Expand Up @@ -494,9 +494,8 @@ static int guac_client_start_pending_users_timer(guac_client* client) {
}

/* Configure the timer to synchronize and clear the pending users */
struct sigevent signal_config = { 0 };
signal_config.sigev_notify = SIGEV_THREAD;
signal_config.sigev_notify_function = guac_client_promote_pending_users;
struct sigevent signal_config = {
.sigev_notify_function = guac_client_promote_pending_users };
signal_config.sigev_value.sival_ptr = client;

/* Create a timer to synchronize any pending users periodically */
Expand All @@ -509,9 +508,10 @@ static int guac_client_start_pending_users_timer(guac_client* client) {
}

/* Configure the pending users timer to run on the defined interval */
struct itimerspec time_config = { 0 };
time_config.it_interval.tv_nsec = GUAC_CLIENT_PENDING_USERS_REFRESH_INTERVAL;
time_config.it_value.tv_nsec = GUAC_CLIENT_PENDING_USERS_REFRESH_INTERVAL;
struct itimerspec time_config = {
.it_interval = { .tv_nsec = GUAC_CLIENT_PENDING_USERS_REFRESH_INTERVAL },
.it_value = { .tv_nsec = GUAC_CLIENT_PENDING_USERS_REFRESH_INTERVAL }
};

/* Start the timer */
if (timer_settime(
Expand Down
2 changes: 1 addition & 1 deletion src/libguac/guacamole/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "client-types.h"
#include "client-constants.h"
#include "layer-types.h"
#include "reentrant-rwlock.h"
#include "guacamole/reentrant-rwlock.h"
#include "object-types.h"
#include "pool-types.h"
#include "socket-types.h"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/libguac/reentrant-rwlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <pthread.h>
#include <stdint.h>
#include "reentrant-rwlock.h"
#include "guacamole/reentrant-rwlock.h"

/**
* The value indicating that the current thread holds neither the read or write
Expand Down

0 comments on commit efc0793

Please sign in to comment.