summaryrefslogtreecommitdiffstats
path: root/xrdp
diff options
context:
space:
mode:
Diffstat (limited to 'xrdp')
-rw-r--r--xrdp/xrdp.c110
-rw-r--r--xrdp/xrdp_cache.c20
-rw-r--r--xrdp/xrdp_interface.c3
-rw-r--r--xrdp/xrdp_listen.c10
-rw-r--r--xrdp/xrdp_login_wnd.c8
-rw-r--r--xrdp/xrdp_region.c3
-rw-r--r--xrdp/xrdp_wm.c6
7 files changed, 79 insertions, 81 deletions
diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c
index 9284929e..5ec69485 100644
--- a/xrdp/xrdp.c
+++ b/xrdp/xrdp.c
@@ -91,8 +91,8 @@ xrdp_shutdown(int sig)
{
return;
}
- g_printf("shutting down\r\n");
- g_printf("signal %d threadid %d\r\n", sig, g_get_threadid());
+ g_writeln("shutting down");
+ g_writeln("signal %d threadid %d", sig, g_get_threadid());
listen = g_listen;
g_listen = 0;
if (listen != 0)
@@ -145,7 +145,7 @@ void DEFAULT_CC
pipe_sig(int sig_num)
{
/* do nothing */
- g_printf("got SIGPIPE(%d)\r\n", sig_num);
+ g_writeln("got SIGPIPE(%d)", sig_num);
}
/*****************************************************************************/
@@ -291,7 +291,7 @@ main(int argc, char** argv)
char text[32];
#endif
- /* check compiled endian with actual edian */
+ /* check compiled endian with actual endian */
test = 1;
host_be = !((int)(*(unsigned char*)(&test)));
#if defined(B_ENDIAN)
@@ -301,23 +301,23 @@ main(int argc, char** argv)
if (host_be)
#endif
{
- g_printf("endian wrong, edit arch.h\r\n");
+ g_writeln("endian wrong, edit arch.h");
return 0;
}
/* check long, int and void* sizes */
if (sizeof(int) != 4)
{
- g_printf("unusable int size, must be 4\r\n");
+ g_writeln("unusable int size, must be 4");
return 0;
}
if (sizeof(long) != sizeof(void*))
{
- g_printf("long size must match void* size\r\n");
+ g_writeln("long size must match void* size");
return 0;
}
if (sizeof(long) != 4 && sizeof(long) != 8)
{
- g_printf("unusable long size, must be 4 or 8\r\n");
+ g_writeln("unusable long size, must be 4 or 8");
return 0;
}
#if defined(_WIN32)
@@ -328,16 +328,16 @@ main(int argc, char** argv)
g_strncasecmp(argv[1], "--help", 255) == 0 ||
g_strncasecmp(argv[1], "-h", 255) == 0)
{
- g_printf("\r\n");
- g_printf("xrdp: A Remote Desktop Protocol server.\r\n");
- g_printf("Copyright (C) Jay Sorg 2004-2005\r\n");
- g_printf("See http://xrdp.sourceforge.net for more information.\r\n");
- g_printf("\r\n");
- g_printf("Usage: xrdp [options]\r\n");
- g_printf(" -h: show help\r\n");
- g_printf(" -install: install service\r\n");
- g_printf(" -remove: remove service\r\n");
- g_printf("\r\n");
+ g_writeln("");
+ g_writeln("xrdp: A Remote Desktop Protocol server.");
+ g_writeln("Copyright (C) Jay Sorg 2004-2005");
+ g_writeln("See http://xrdp.sourceforge.net for more information.");
+ g_writeln("");
+ g_writeln("Usage: xrdp [options]");
+ g_writeln(" -h: show help");
+ g_writeln(" -install: install service");
+ g_writeln(" -remove: remove service");
+ g_writeln("");
g_exit(0);
}
else if (g_strncasecmp(argv[1], "-install", 255) == 0 ||
@@ -348,7 +348,7 @@ main(int argc, char** argv)
sc_man = OpenSCManager(0, 0, GENERIC_WRITE);
if (sc_man == 0)
{
- g_printf("error OpenSCManager, do you have rights?\r\n");
+ g_writeln("error OpenSCManager, do you have rights?");
g_exit(0);
}
/* check if service is allready installed */
@@ -364,7 +364,7 @@ main(int argc, char** argv)
}
else
{
- g_printf("error service is allready installed\r\n");
+ g_writeln("error service is allready installed");
CloseServiceHandle(sc_ser);
CloseServiceHandle(sc_man);
g_exit(0);
@@ -380,14 +380,14 @@ main(int argc, char** argv)
sc_man = OpenSCManager(0, 0, GENERIC_WRITE);
if (sc_man == 0)
{
- g_printf("error OpenSCManager, do you have rights?\r\n");
+ g_writeln("error OpenSCManager, do you have rights?");
g_exit(0);
}
/* check if service is allready installed */
sc_ser = OpenService(sc_man, "xrdp", SERVICE_ALL_ACCESS);
if (sc_ser == 0)
{
- g_printf("error service is not installed\r\n");
+ g_writeln("error service is not installed");
CloseServiceHandle(sc_man);
g_exit(0);
}
@@ -397,17 +397,17 @@ main(int argc, char** argv)
}
else
{
- g_printf("Unknown Parameter\r\n");
- g_printf("xrdp -h for help\r\n");
- g_printf("\r\n");
+ g_writeln("Unknown Parameter");
+ g_writeln("xrdp -h for help");
+ g_writeln("");
g_exit(0);
}
}
else if (argc > 1)
{
- g_printf("Unknown Parameter\r\n");
- g_printf("xrdp -h for help\r\n");
- g_printf("\r\n");
+ g_writeln("Unknown Parameter");
+ g_writeln("xrdp -h for help");
+ g_writeln("");
g_exit(0);
}
if (run_as_service)
@@ -429,7 +429,7 @@ main(int argc, char** argv)
if (g_strncasecmp(argv[1], "-kill", 255) == 0 ||
g_strncasecmp(argv[1], "--kill", 255) == 0)
{
- g_printf("stopping xrdp\r\n");
+ g_writeln("stopping xrdp");
/* read the xrdp.pid file */
fd = -1;
if (g_file_exist(XRDP_PID_FILE)) /* xrdp.pid */
@@ -438,15 +438,15 @@ main(int argc, char** argv)
}
if (fd == -1)
{
- g_printf("problem opening to xrdp.pid\r\n");
- g_printf("maybe its not running\r\n");
+ g_writeln("problem opening to xrdp.pid");
+ g_writeln("maybe its not running");
}
else
{
g_memset(text, 0, 32);
g_file_read(fd, text, 31);
pid = g_atoi(text);
- g_printf("stopping process id %d\r\n", pid);
+ g_writeln("stopping process id %d", pid);
if (pid > 0)
{
g_sigterm(pid);
@@ -464,37 +464,37 @@ main(int argc, char** argv)
g_strncasecmp(argv[1], "--help", 255) == 0 ||
g_strncasecmp(argv[1], "-h", 255) == 0)
{
- g_printf("\r\n");
- g_printf("xrdp: A Remote Desktop Protocol server.\r\n");
- g_printf("Copyright (C) Jay Sorg 2004-2005\r\n");
- g_printf("See http://xrdp.sourceforge.net for more information.\r\n");
- g_printf("\r\n");
- g_printf("Usage: xrdp [options]\r\n");
- g_printf(" -h: show help\r\n");
- g_printf(" -nodaemon: don't fork into background\r\n");
- g_printf(" -kill: shut down xrdp\r\n");
- g_printf("\r\n");
+ g_writeln("");
+ g_writeln("xrdp: A Remote Desktop Protocol server.");
+ g_writeln("Copyright (C) Jay Sorg 2004-2005");
+ g_writeln("See http://xrdp.sourceforge.net for more information.");
+ g_writeln("");
+ g_writeln("Usage: xrdp [options]");
+ g_writeln(" -h: show help");
+ g_writeln(" -nodaemon: don't fork into background");
+ g_writeln(" -kill: shut down xrdp");
+ g_writeln("");
g_exit(0);
}
else
{
- g_printf("Unknown Parameter\r\n");
- g_printf("xrdp -h for help\r\n");
- g_printf("\r\n");
+ g_writeln("Unknown Parameter");
+ g_writeln("xrdp -h for help");
+ g_writeln("");
g_exit(0);
}
}
else if (argc > 1)
{
- g_printf("Unknown Parameter\r\n");
- g_printf("xrdp -h for help\r\n");
- g_printf("\r\n");
+ g_writeln("Unknown Parameter");
+ g_writeln("xrdp -h for help");
+ g_writeln("");
g_exit(0);
}
if (g_file_exist(XRDP_PID_FILE)) /* xrdp.pid */
{
- g_printf("It looks like xrdp is allready running,\r\n");
- g_printf("if not delete the xrdp.pid file and try again\r\n");
+ g_writeln("It looks like xrdp is allready running,");
+ g_writeln("if not delete the xrdp.pid file and try again");
g_exit(0);
}
if (!no_daemon)
@@ -503,12 +503,12 @@ main(int argc, char** argv)
pid = g_fork();
if (pid == -1)
{
- g_printf("problem forking\r\n");
+ g_writeln("problem forking");
g_exit(1);
}
if (0 != pid)
{
- g_printf("process %d started ok\r\n", pid);
+ g_writeln("process %d started ok", pid);
/* exit, this is the main process */
g_exit(0);
}
@@ -526,9 +526,9 @@ main(int argc, char** argv)
fd = g_file_open(XRDP_PID_FILE); /* xrdp.pid */
if (fd == -1)
{
- g_printf("trying to write process id to xrdp.pid\r\n");
- g_printf("problem opening xrdp.pid\r\n");
- g_printf("maybe no rights\r\n");
+ g_writeln("trying to write process id to xrdp.pid");
+ g_writeln("problem opening xrdp.pid");
+ g_writeln("maybe no rights");
}
else
{
diff --git a/xrdp/xrdp_cache.c b/xrdp/xrdp_cache.c
index cfde462f..8a6b6b56 100644
--- a/xrdp/xrdp_cache.c
+++ b/xrdp/xrdp_cache.c
@@ -158,7 +158,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap)
#endif
{
self->bitmap_items[i][j].stamp = self->bitmap_stamp;
- DEBUG(("found bitmap at %d %d\r\n", i, j));
+ DEBUG(("found bitmap at %d %d", i, j));
xrdp_bitmap_delete(bitmap);
return MAKELONG(j, i);
}
@@ -176,7 +176,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap)
#endif
{
self->bitmap_items[i][j].stamp = self->bitmap_stamp;
- DEBUG(("found bitmap at %d %d\r\n", i, j));
+ DEBUG(("found bitmap at %d %d", i, j));
xrdp_bitmap_delete(bitmap);
return MAKELONG(j, i);
}
@@ -194,7 +194,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap)
#endif
{
self->bitmap_items[i][j].stamp = self->bitmap_stamp;
- DEBUG(("found bitmap at %d %d\r\n", i, j));
+ DEBUG(("found bitmap at %d %d", i, j));
xrdp_bitmap_delete(bitmap);
return MAKELONG(j, i);
}
@@ -202,7 +202,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap)
}
else
{
- g_printf("error in xrdp_cache_add_bitmap, too big(%d)\r\n", bmp_size);
+ g_writeln("error in xrdp_cache_add_bitmap, too big(%d)", bmp_size);
}
/* look for oldest */
cache_id = 0;
@@ -247,7 +247,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap)
}
}
}
- DEBUG(("adding bitmap at %d %d\r\n", cache_id, cache_idx));
+ DEBUG(("adding bitmap at %d %d", cache_id, cache_idx));
/* set, send bitmap and return */
xrdp_bitmap_delete(self->bitmap_items[cache_id][cache_idx].bitmap);
self->bitmap_items[cache_id][cache_idx].bitmap = bitmap;
@@ -358,7 +358,7 @@ xrdp_cache_add_char(struct xrdp_cache* self,
if (xrdp_font_item_compare(&self->char_items[i][j].font_item, font_item))
{
self->char_items[i][j].stamp = self->char_stamp;
- DEBUG(("found font at %d %d\r\n", i, j));
+ DEBUG(("found font at %d %d", i, j));
return MAKELONG(j, i);
}
}
@@ -379,7 +379,7 @@ xrdp_cache_add_char(struct xrdp_cache* self,
}
}
}
- DEBUG(("adding char at %d %d\r\n", f, c));
+ DEBUG(("adding char at %d %d", f, c));
/* set, send char and return */
fi = &self->char_items[f][c].font_item;
g_free(fi->data);
@@ -426,7 +426,7 @@ xrdp_cache_add_pointer(struct xrdp_cache* self,
self->pointer_items[i].stamp = self->pointer_stamp;
xrdp_wm_set_pointer(self->wm, i);
self->wm->current_pointer = i;
- DEBUG(("found pointer at %d\r\n", i));
+ DEBUG(("found pointer at %d", i));
return i;
}
}
@@ -454,7 +454,7 @@ xrdp_cache_add_pointer(struct xrdp_cache* self,
self->pointer_items[index].x,
self->pointer_items[index].y);
self->wm->current_pointer = index;
- DEBUG(("adding pointer at %d\r\n", index));
+ DEBUG(("adding pointer at %d", index));
return index;
}
@@ -482,6 +482,6 @@ xrdp_cache_add_pointer_static(struct xrdp_cache* self,
self->pointer_items[index].x,
self->pointer_items[index].y);
self->wm->current_pointer = index;
- DEBUG(("adding pointer at %d\r\n", index));
+ DEBUG(("adding pointer at %d", index));
return index;
}
diff --git a/xrdp/xrdp_interface.c b/xrdp/xrdp_interface.c
index 5d517c24..1bf1a8f4 100644
--- a/xrdp/xrdp_interface.c
+++ b/xrdp/xrdp_interface.c
@@ -186,8 +186,7 @@ server_msg(struct xrdp_mod* mod, char* msg, int code)
if (code == 1)
{
- g_printf(msg);
- g_printf("\r\n");
+ g_writeln(msg);
return 0;
}
wm = (struct xrdp_wm*)mod->wm;
diff --git a/xrdp/xrdp_listen.c b/xrdp/xrdp_listen.c
index 7b3a5205..6f17ebb6 100644
--- a/xrdp/xrdp_listen.c
+++ b/xrdp/xrdp_listen.c
@@ -116,7 +116,7 @@ xrdp_listen_delete_pro(struct xrdp_listen* self, struct xrdp_process* pro)
{
if (self->process_list[i] == pro)
{
- DEBUG(("process deleted\r\n"));
+ DEBUG(("process deleted"));
xrdp_process_delete(pro);
self->process_list[i] = 0;
return 0;
@@ -130,9 +130,9 @@ xrdp_listen_delete_pro(struct xrdp_listen* self, struct xrdp_process* pro)
THREAD_RV THREAD_CC
xrdp_process_run(void* in_val)
{
- DEBUG(("process started\r\n"));
+ DEBUG(("process started"));
xrdp_process_main_loop(g_process);
- DEBUG(("process done\r\n"));
+ DEBUG(("process done"));
return 0;
}
@@ -189,7 +189,7 @@ xrdp_listen_main_loop(struct xrdp_listen* self)
error = g_tcp_bind(self->sck, port);
if (error != 0)
{
- g_printf("bind error in xrdp_listen_main_loop\r\n");
+ g_writeln("bind error in xrdp_listen_main_loop");
g_tcp_close(self->sck);
self->status = -1;
return 1;
@@ -228,7 +228,7 @@ xrdp_listen_main_loop(struct xrdp_listen* self)
}
else
{
- DEBUG(("listen error in xrdp_listen_main_loop\r\n"));
+ DEBUG(("listen error in xrdp_listen_main_loop"));
}
xrdp_listen_term_processes(self);
g_tcp_close(self->sck);
diff --git a/xrdp/xrdp_login_wnd.c b/xrdp/xrdp_login_wnd.c
index 855fd02d..9481d355 100644
--- a/xrdp/xrdp_login_wnd.c
+++ b/xrdp/xrdp_login_wnd.c
@@ -128,7 +128,7 @@ xrdp_wm_setup_mod1(struct xrdp_wm* self,
}
if (func == 0)
{
- g_printf("error finding proc mod_init in %s\r\n", mod_data->lib);
+ g_writeln("error finding proc mod_init in %s", mod_data->lib);
}
self->mod_init = (struct xrdp_mod* (*)(void))func;
func = g_get_proc_address(self->mod_handle, "mod_exit");
@@ -138,7 +138,7 @@ xrdp_wm_setup_mod1(struct xrdp_wm* self,
}
if (func == 0)
{
- g_printf("error finding proc mod_exit in %s\r\n", mod_data->lib);
+ g_writeln("error finding proc mod_exit in %s", mod_data->lib);
}
self->mod_exit = (int (*)(struct xrdp_mod*))func;
if (self->mod_init != 0 && self->mod_exit != 0)
@@ -148,7 +148,7 @@ xrdp_wm_setup_mod1(struct xrdp_wm* self,
}
else
{
- g_printf("error loading %s\r\n", mod_data->lib);
+ g_writeln("error loading %s", mod_data->lib);
}
if (self->mod != 0)
{
@@ -179,7 +179,7 @@ xrdp_wm_setup_mod1(struct xrdp_wm* self,
/* id self->mod is null, there must be a problem */
if (self->mod == 0)
{
- DEBUG(("problem loading lib in xrdp_wm_setup_mod1\r\n"));
+ DEBUG(("problem loading lib in xrdp_wm_setup_mod1"));
return 1;
}
return 0;
diff --git a/xrdp/xrdp_region.c b/xrdp/xrdp_region.c
index 06c4d7f8..dd7b09dc 100644
--- a/xrdp/xrdp_region.c
+++ b/xrdp/xrdp_region.c
@@ -90,7 +90,6 @@ xrdp_region_subtract_rect(struct xrdp_region* self,
r = (struct xrdp_rect*)list_get_item(self->rects, i);
rect1 = *r;
r = &rect1;
- //g_printf("r is %d %d %d %d\n", r->left, r->top, r->right, r->bottom);
if (rect->left <= r->left &&
rect->top <= r->top &&
rect->right >= r->right &&
@@ -275,7 +274,7 @@ xrdp_region_subtract_rect(struct xrdp_region* self,
}
else
{
- g_printf("error in xrdp_region_subtract_rect\r\n");
+ g_writeln("error in xrdp_region_subtract_rect");
}
}
return 0;
diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c
index b98fea04..8c00f9b8 100644
--- a/xrdp/xrdp_wm.c
+++ b/xrdp/xrdp_wm.c
@@ -342,11 +342,11 @@ xrdp_wm_load_static_pointers(struct xrdp_wm* self)
{
struct xrdp_pointer_item pointer_item;
- DEBUG(("sending cursor\r\n"));
+ DEBUG(("sending cursor"));
xrdp_wm_load_pointer(self, "cursor1.cur", pointer_item.data,
pointer_item.mask, &pointer_item.x, &pointer_item.y);
xrdp_cache_add_pointer_static(self->cache, &pointer_item, 1);
- DEBUG(("sending cursor\r\n"));
+ DEBUG(("sending cursor"));
xrdp_wm_load_pointer(self, "cursor0.cur", pointer_item.data,
pointer_item.mask, &pointer_item.x, &pointer_item.y);
xrdp_cache_add_pointer_static(self->cache, &pointer_item, 0);
@@ -1192,7 +1192,7 @@ static int APP_CC
xrdp_wm_process_input_mouse(struct xrdp_wm* self, int device_flags,
int x, int y)
{
- DEBUG(("mouse event flags %4.4x x %d y %d\r\n", device_flags, x, y));
+ DEBUG(("mouse event flags %4.4x x %d y %d", device_flags, x, y));
if (device_flags & MOUSE_FLAG_MOVE) /* 0x0800 */
{
xrdp_wm_mouse_move(self->pro_layer->wm, x, y);