The Mac OS X 10.5 SDK requires the second argument of FD_ISSET to be writeable, although it does only access the data. Given that we have a const pointer for a const struct, copy and pass that. Note that this is merely a workaround for OS X 10.5, as 10.6 and later define the second argument of FD_ISSET as const struct const *foo, too. It it safe, as data is accessed read-only by FD_ISSET, even on 10.5. Signed-off-by: Mihai Moldovan <ionic@ionic.de> --- nxcomp/Agent.h | 28 ++++++++++++++++++++-------- 1 files changed, 20 insertions(+), 8 deletions(-) diff --git a/nxcomp/Agent.h b/nxcomp/Agent.h index fac5acd..ded344d 100644 --- a/nxcomp/Agent.h +++ b/nxcomp/Agent.h @@ -149,30 +149,38 @@ class Agent int remoteCanRead(const fd_set * const readSet) { + // OS X 10.5 requires the second argument to be non-const, so copy readSet. + // It's safe though, as FD_ISSET does not operate on it. + fd_set readWorkSet = *readSet; + #if defined(TEST) || defined(INFO) *logofs << "Agent: remoteCanRead() is " << - (FD_ISSET(remoteFd_, readSet) && transport_ -> dequeuable() != 0) - << " with FD_ISSET() " << (int) FD_ISSET(remoteFd_, readSet) + (FD_ISSET(remoteFd_, &readWorkSet) && transport_ -> dequeuable() != 0) + << " with FD_ISSET() " << (int) FD_ISSET(remoteFd_, &readWorkSet) << " and dequeuable " << transport_ -> dequeuable() << ".\n" << logofs_flush; #endif - return (FD_ISSET(remoteFd_, readSet) && + return (FD_ISSET(remoteFd_, &readWorkSet) && transport_ -> dequeuable() != 0); } int remoteCanWrite(const fd_set * const writeSet) { + // OS X 10.5 requires the second argument to be non-const, so copy writeSet. + // It's safe though, as FD_ISSET does not operate on it. + fd_set writeWorkSet = *writeSet; + #if defined(TEST) || defined(INFO) *logofs << "Agent: remoteCanWrite() is " << - (FD_ISSET(remoteFd_, writeSet) && transport_ -> + (FD_ISSET(remoteFd_, &writeWorkSet) && transport_ -> queuable() != 0 && canRead_ == 1) << " with FD_ISSET() " - << (int) FD_ISSET(remoteFd_, writeSet) << " queueable " + << (int) FD_ISSET(remoteFd_, &writeWorkSet) << " queueable " << transport_ -> queuable() << " channel can read " << canRead_ << ".\n" << logofs_flush; #endif - return (FD_ISSET(remoteFd_, writeSet) && + return (FD_ISSET(remoteFd_, &writeWorkSet) && transport_ -> queuable() != 0 && canRead_ == 1); } @@ -203,13 +211,17 @@ class Agent int proxyCanRead(const fd_set * const readSet) { + // OS X 10.5 requires the second argument to be non-const, so copy readSet. + // It's safe though, as FD_ISSET does not operate on it. + fd_set readWorkSet = *readSet; + #if defined(TEST) || defined(INFO) *logofs << "Agent: proxyCanRead() is " - << ((int) FD_ISSET(proxy -> getFd(), readSet) + << ((int) FD_ISSET(proxy -> getFd(), &readWorkSet) << ".\n" << logofs_flush; #endif - return (FD_ISSET(proxy -> getFd(), readSet)); + return (FD_ISSET(proxy -> getFd(), &readWorkSet)); } int enqueueData(const char *data, const int size) const -- 1.7.9
Hi Mihai, On So 26 Feb 2012 09:18:53 CET Mihai Moldovan wrote:
The Mac OS X 10.5 SDK requires the second argument of FD_ISSET to be writeable, although it does only access the data. Given that we have a const pointer for a const struct, copy and pass that.
Note that this is merely a workaround for OS X 10.5, as 10.6 and later define the second argument of FD_ISSET as const struct const *foo, too.
It it safe, as data is accessed read-only by FD_ISSET, even on 10.5.
Signed-off-by: Mihai Moldovan <ionic@ionic.de>
nxcomp/Agent.h | 28 ++++++++++++++++++++-------- 1 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/nxcomp/Agent.h b/nxcomp/Agent.h index fac5acd..ded344d 100644 --- a/nxcomp/Agent.h +++ b/nxcomp/Agent.h @@ -149,30 +149,38 @@ class Agent
int remoteCanRead(const fd_set * const readSet) {
- // OS X 10.5 requires the second argument to be non-const, so copy readSet.
- // It's safe though, as FD_ISSET does not operate on it.
- fd_set readWorkSet = *readSet;
- #if defined(TEST) || defined(INFO) *logofs << "Agent: remoteCanRead() is " <<
dequeuable() != 0)(FD_ISSET(remoteFd_, readSet) && transport_ ->
<< " with FD_ISSET() " << (int) FD_ISSET(remoteFd_, readSet)
dequeuable() != 0)(FD_ISSET(remoteFd_, &readWorkSet) && transport_ ->
&readWorkSet) << " and dequeuable " << transport_ -> dequeuable() << ".n" << logofs_flush; #endif<< " with FD_ISSET() " << (int) FD_ISSET(remoteFd_,
- return (FD_ISSET(remoteFd_, readSet) &&
- return (FD_ISSET(remoteFd_, &readWorkSet) && transport_ -> dequeuable() != 0); }
int remoteCanWrite(const fd_set * const writeSet) {
- // OS X 10.5 requires the second argument to be non-const, so copy writeSet.
- // It's safe though, as FD_ISSET does not operate on it.
- fd_set writeWorkSet = *writeSet;
- #if defined(TEST) || defined(INFO) *logofs << "Agent: remoteCanWrite() is " <<
(FD_ISSET(remoteFd_, writeSet) && transport_ ->
(FD_ISSET(remoteFd_, &writeWorkSet) && transport_ -> queuable() != 0 && canRead_ == 1) << " with FD_ISSET() "
<< (int) FD_ISSET(remoteFd_, writeSet) << " queueable "
#endif<< (int) FD_ISSET(remoteFd_, &writeWorkSet) << " queueable " << transport_ -> queuable() << " channel can read " << canRead_ << ".n" << logofs_flush;
- return (FD_ISSET(remoteFd_, writeSet) &&
- return (FD_ISSET(remoteFd_, &writeWorkSet) && transport_ -> queuable() != 0 && canRead_ == 1); } @@ -203,13 +211,17 @@ class Agent
int proxyCanRead(const fd_set * const readSet) {
- // OS X 10.5 requires the second argument to be non-const, so copy readSet.
- // It's safe though, as FD_ISSET does not operate on it.
- fd_set readWorkSet = *readSet;
- #if defined(TEST) || defined(INFO) *logofs << "Agent: proxyCanRead() is "
<< ((int) FD_ISSET(proxy -> getFd(), readSet)
#endif<< ((int) FD_ISSET(proxy -> getFd(), &readWorkSet) << ".n" << logofs_flush;
- return (FD_ISSET(proxy -> getFd(), readSet));
- return (FD_ISSET(proxy -> getFd(), &readWorkSet)); }
int enqueueData(const char *data, const int size) const
1.7.9
patch applied... http://code.x2go.org/gitweb?p=nx-libs.git;a=commitdiff;h=655173ff215dde1a167... I had to tweak the patch by hand so it could get applied fully. Not sure what went wrong, so I just place a reminder here to make sure patches apply against latest Git code well enough. Mike -- DAS-NETZWERKTEAM mike gabriel, dorfstr. 27, 24245 barmissen fon: +49 (4302) 281418, fax: +49 (4302) 281419 GnuPG Key ID 0xB588399B mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xf...
Hi Mike,
sorry, from what I can see my mail client wrapped at least two long lines and inserted a newline where none should have been...
I.e., here:
(FD_ISSET(remoteFd_, readSet) && transport_ ->
dequeuable() != 0)Sorry, I haven't seen it and revised my settings to make sure reasonably long lines are not split anymore. Let's see how this works out. :)
Best regards,
Mihai
patch applied... http://code.x2go.org/gitweb?p=nx-libs.git;a=commitdiff;h=655173ff215dde1a167...
I had to tweak the patch by hand so it could get applied fully. Not sure what went wrong, so I just place a reminder here to make sure patches apply against latest Git code well enough.
Hi,
although some people think differently I think is a good idea to attach patches instead of inlining them.
Cheers Morty
On 2012-02-29 16:08, Mihai Moldovan wrote:
Hi Mike,
sorry, from what I can see my mail client wrapped at least two long lines and inserted a newline where none should have been...
I.e., here:
dequeuable() != 0)(FD_ISSET(remoteFd_, readSet) && transport_ ->
Sorry, I haven't seen it and revised my settings to make sure reasonably long lines are not split anymore. Let's see how this works out. :)
Best regards,
Mihai
- On 29.02.2012 04:01 PM, Mike Gabriel wrote:
patch applied... http://code.x2go.org/gitweb?p=nx-libs.git;a=commitdiff;h=655173ff215dde1a167...
I had to tweak the patch by hand so it could get applied fully. Not sure what went wrong, so I just place a reminder here to make sure patches apply against latest Git code well enough.
X2Go-Dev mailing list X2Go-Dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/x2go-dev
-- Dipl.-Ing. Moritz 'Morty' Struebe (Wissenschaftlicher Mitarbeiter) Lehrstuhl für Informatik 4 (Verteilte Systeme und Betriebssysteme) Friedrich-Alexander-Universität Erlangen-Nürnberg Martensstr. 1 91058 Erlangen
Tel : +49 9131 85-25419 Fax : +49 9131 85-28732 eMail : struebe@informatik.uni-erlangen.de WWW : http://www4.informatik.uni-erlangen.de/~morty
Hi Morty, hi contributors,
On Mi 29 Feb 2012 16:16:20 CET Moritz Struebe wrote:
Hi,
although some people think differently I think is a good idea to attach patches instead of inlining them.
Cheers Morty
I was about to write the same after having worked through all of the
latest patches on the ML.
Thanks for bringing it up, +1 from me, Mike
--
DAS-NETZWERKTEAM mike gabriel, dorfstr. 27, 24245 barmissen fon: +49 (4302) 281418, fax: +49 (4302) 281419
GnuPG Key ID 0xB588399B mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xf...
patch applied... http://code.x2go.org/gitweb?p=nx-libs.git;a=commitdiff;h=655173ff215dde1a167...
I had to tweak the patch by hand so it could get applied fully. Not sure what went wrong, so I just place a reminder here to make sure patches apply against latest Git code well enough.
Oh, I see you removed some necessary addressof operators, which now makes the code fail on compilation. :/
I'll send a patch against the patch, I guess that should be OK.
Btw: git-quiltimport couldn't apply some other patch because the nxcomp directory was called "nxcomp-ubuntu" in one part of the patch, for some weird reason. I'll also send a patch for that and let you decide whether to include it or not (as maybe this is a git-quiltimport limitation and the real quilt stuff is more intelligent to figure out fuzzy file locations.)