fixed broken keygen

This commit is contained in:
chombier 2001-03-22 10:23:07 +00:00
parent bc633a75e8
commit 54e7f590e3
2 changed files with 45 additions and 4 deletions

View File

@ -25,6 +25,8 @@
#include "netevent.proto.h"
#include "network.proto.h"
#include "GUSITTY.h"
#include <GUSIInternal.h>
#include <GUSIBasics.h>
#include <GUSIContext.h>
@ -171,6 +173,43 @@ GUSISIOUXSocket::GUSISIOUXSocket()
}
*/
/*
* default GUSISIOUXSocket::select checks for keyDown or
* autoKey events from MacOS's EventQueue.
* we use an internal buffer.
*/
class GUSISIOUXSocket : public GUSISocket {
public:
~GUSISIOUXSocket();
ssize_t read(const GUSIScatterer & buffer);
ssize_t write(const GUSIGatherer & buffer);
virtual int ioctl(unsigned int request, va_list arg);
virtual int fstat(struct stat * buf);
virtual int isatty();
bool select(bool * canRead, bool * canWrite, bool *);
static GUSISIOUXSocket * Instance();
private:
static GUSISIOUXSocket * sInstance;
GUSISIOUXSocket();
};
bool GUSISIOUXSocket::select(bool * canRead, bool * canWrite, bool *)
{
bool cond = false;
if (canRead) {
if (*canRead = (AvailableFromTTY(0, (lshcontext *)pthread_getspecific(ssh2threadkey))))
cond = true;
}
if (canWrite)
cond = *canWrite = true;
return cond;
}
/*
* default GUSIProcess::Yield has 20 ticks to remain in same state
* we use 0.

View File

@ -94,8 +94,9 @@ long WriteCharsToConsole(char *buffer, long n)
/* since we redirect stdin/out/err to our 'sockets'
* this shouldn't occur ! (or lsh calls printf ? (; )
*/
DebugStr("\pWriteCharsToConsole");
return n;
// DebugStr("\pWriteCharsToConsole");
// return n;
return WriteCharsToTTY(1, pthread_getspecific(ssh2threadkey), buffer, n);
}
/*
@ -116,8 +117,9 @@ long ReadCharsFromConsole(char *buffer, long n)
/* since we redirect stdin/out/err to our 'sockets'
* this shouldn't occur ! (or lsh calls printf ? (; )
*/
DebugStr("\pReadCharsFromConsole");
return 0;
// DebugStr("\pReadCharsFromConsole");
// return 0;
return ReadCharsFromTTY(0, pthread_getspecific(ssh2threadkey), buffer, n);
}
/*