summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authornorrarvid <norrarvid@gmail.com>2012-05-29 12:46:56 +0200
committernorrarvid <norrarvid@gmail.com>2012-05-29 12:46:56 +0200
commita45f993bfe74aed27245454f1ae32302b0528d9f (patch)
treee51af5e1c32bae783023e64da88f69eab2e25566 /common
parent900a2541ca94b5c4cb839c3bd6d35e6460ca1c48 (diff)
downloadxrdp-proprietary-a45f993bfe74aed27245454f1ae32302b0528d9f.tar.gz
xrdp-proprietary-a45f993bfe74aed27245454f1ae32302b0528d9f.zip
added comments, added define, removed unused inparameter
Diffstat (limited to 'common')
-rw-r--r--common/os_calls.c47
-rw-r--r--common/trans.c2
-rw-r--r--common/trans.h2
3 files changed, 31 insertions, 20 deletions
diff --git a/common/os_calls.c b/common/os_calls.c
index 692dc015..eb5bdea5 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -1055,28 +1055,39 @@ g_obj_wait(tbus* read_objs, int rcount, tbus* write_objs, int wcount,
ptime = &time;
}
FD_ZERO(&rfds);
- FD_ZERO(&wfds);
- for (i = 0; i < rcount; i++)
- {
- sck = (int)(read_objs[i]);
- if (sck > 0) {
- FD_SET(sck, &rfds);
- if (sck > max)
- {
- max = sck;
+ FD_ZERO(&wfds);
+ /*Find the highest descriptor number in read_obj */
+ if(read_objs!=NULL){
+ for (i = 0; i < rcount; i++)
+ {
+ sck = (int)(read_objs[i]);
+ if (sck > 0) {
+ FD_SET(sck, &rfds);
+ if (sck > max)
+ {
+ max = sck; /*max holds the highest socket/descriptor number */
+ }
}
}
+ }else if(rcount>0){
+ g_writeln("Programming error read_objs is null");
+ return 1; /*error*/
}
- for (i = 0; i < wcount; i++)
- {
- sck = (int)(write_objs[i]);
- if (sck > 0) {
- FD_SET(sck, &wfds);
- if (sck > max)
- {
- max = sck;
+ if(write_objs!=NULL){
+ for (i = 0; i < wcount; i++)
+ {
+ sck = (int)(write_objs[i]);
+ if (sck > 0) {
+ FD_SET(sck, &wfds);
+ if (sck > max)
+ {
+ max = sck; /*max holds the highest socket/descriptor number */
+ }
}
}
+ }else if(wcount>0){
+ g_writeln("Programming error write_objs is null");
+ return 1; /*error*/
}
res = select(max + 1, &rfds, &wfds, 0, ptime);
if (res < 0)
@@ -1089,7 +1100,7 @@ g_obj_wait(tbus* read_objs, int rcount, tbus* write_objs, int wcount,
{
return 0;
}
- return 1;
+ return 1; /*error*/
}
return 0;
#endif
diff --git a/common/trans.c b/common/trans.c
index 377b90ba..6b762d00 100644
--- a/common/trans.c
+++ b/common/trans.c
@@ -69,7 +69,7 @@ trans_delete(struct trans* self)
/*****************************************************************************/
int APP_CC
-trans_get_wait_objs(struct trans* self, tbus* objs, int* count, int* timeout)
+trans_get_wait_objs(struct trans* self, tbus* objs, int* count)
{
if (self == 0)
{
diff --git a/common/trans.h b/common/trans.h
index bb0f42c0..8e8d942a 100644
--- a/common/trans.h
+++ b/common/trans.h
@@ -64,7 +64,7 @@ trans_create(int mode, int in_size, int out_size);
void APP_CC
trans_delete(struct trans* self);
int APP_CC
-trans_get_wait_objs(struct trans* self, tbus* objs, int* count, int* timeout);
+trans_get_wait_objs(struct trans* self, tbus* objs, int* count);
int APP_CC
trans_check_wait_objs(struct trans* self);
int APP_CC