GUAC-598: Bring up to compliance with POSIX standard claimed by source.
This commit is contained in:
parent
20222beaed
commit
d24aaeb614
@ -40,8 +40,8 @@ AC_PROG_LIBTOOL
|
||||
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h time.h sys/time.h syslog.h unistd.h cairo/cairo.h pngstruct.h])
|
||||
|
||||
# Source characteristics
|
||||
AC_DEFINE([_POSIX_C_SOURCE], [200809L], [Uses POSIX APIs])
|
||||
AC_DEFINE([_BSD_SOURCE], [], [Uses BSD APIs])
|
||||
AC_DEFINE([_XOPEN_SOURCE], [700], [Uses X/Open and POSIX APIs])
|
||||
AC_DEFINE([_BSD_SOURCE], [], [Uses BSD APIs])
|
||||
|
||||
# libpng
|
||||
AC_CHECK_LIB([png], [png_write_png], [PNG_LIBS=-lpng],
|
||||
|
@ -20,8 +20,6 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define _XOPEN_SOURCE 500
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "client.h"
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <rfb/rfbclient.h>
|
||||
#include <guacamole/audio.h>
|
||||
@ -280,12 +281,17 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
|
||||
/* If unsuccessful, retry as many times as specified */
|
||||
while (!rfb_client && retries_remaining > 0) {
|
||||
|
||||
struct timespec guac_vnc_connect_interval = {
|
||||
.tv_sec = GUAC_VNC_CONNECT_INTERVAL/1000,
|
||||
.tv_nsec = (GUAC_VNC_CONNECT_INTERVAL%1000)*1000000
|
||||
};
|
||||
|
||||
guac_client_log_info(client,
|
||||
"Connect failed. Waiting %ims before retrying...",
|
||||
GUAC_VNC_CONNECT_INTERVAL);
|
||||
|
||||
/* Wait for given interval then retry */
|
||||
usleep(GUAC_VNC_CONNECT_INTERVAL*1000);
|
||||
nanosleep(&guac_vnc_connect_interval, NULL);
|
||||
rfb_client = __guac_vnc_get_client(client);
|
||||
retries_remaining--;
|
||||
|
||||
|
@ -317,23 +317,31 @@ void guac_vnc_cut_text(rfbClient* client, const char* text, int textlen) {
|
||||
|
||||
void guac_vnc_client_log_info(const char* format, ...) {
|
||||
|
||||
char message[2048];
|
||||
|
||||
/* Copy log message into buffer */
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
vsyslog(LOG_INFO, format, args);
|
||||
|
||||
vsnprintf(message, sizeof(message), format, args);
|
||||
va_end(args);
|
||||
|
||||
/* Log to syslog */
|
||||
syslog(LOG_INFO, "%s", message);
|
||||
|
||||
}
|
||||
|
||||
void guac_vnc_client_log_error(const char* format, ...) {
|
||||
|
||||
char message[2048];
|
||||
|
||||
/* Copy log message into buffer */
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
vsyslog(LOG_ERR, format, args);
|
||||
|
||||
vsnprintf(message, sizeof(message), format, args);
|
||||
va_end(args);
|
||||
|
||||
/* Log to syslog */
|
||||
syslog(LOG_ERR, "%s", message);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user