From 4cddff12101845cf3e2f94b0d1d5512351af2a7f Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 16 Mar 2019 18:57:45 -0500 Subject: [PATCH] Enhance debug logging of SHM related functions --- common/os_calls.c | 4 ++-- xup/xup.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common/os_calls.c b/common/os_calls.c index dbef8da6..47dbf1ee 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -3322,12 +3322,12 @@ g_text2bool(const char *s) } /*****************************************************************************/ -/* returns pointer or nil on error */ +/* returns pointer or -1 on error */ void * APP_CC g_shmat(int shmid) { #if defined(_WIN32) - return 0; + return -1; #else return shmat(shmid, 0, 0); #endif diff --git a/xup/xup.c b/xup/xup.c index 32b84f50..8e2fcd79 100644 --- a/xup/xup.c +++ b/xup/xup.c @@ -32,6 +32,7 @@ #include #include #include +#include /******************************************************************************/ /** @@ -1202,6 +1203,7 @@ process_server_paint_rect_shmem(struct mod *amod, struct stream *s) amod->screen_shmem_id = 0; amod->screen_shmem_pixels = 0; amod->screen_shmem_id_mapped = 0; + log_message(LOG_LEVEL_ERROR, "g_shmat() returned error, errno: %d\nIs X11rdp running on the same host as xrdp?\n", errno); } else { @@ -1313,6 +1315,7 @@ process_server_paint_rect_shmem_ex(struct mod *amod, struct stream *s) amod->screen_shmem_id = 0; amod->screen_shmem_pixels = 0; amod->screen_shmem_id_mapped = 0; + log_message(LOG_LEVEL_ERROR, "g_shmat() returned error, errno: %d\nIs X11rdp running on the same host as xrdp?\n", errno); } else {