mirror of https://github.com/macssh/macssh.git
MacCvs changes
This commit is contained in:
parent
38d6af1704
commit
4d2942dc7c
Binary file not shown.
|
@ -323,6 +323,7 @@ char * strsignal(int signo)
|
||||||
static char errstr[__max_errstr];
|
static char errstr[__max_errstr];
|
||||||
|
|
||||||
sprintf(errstr, "Signal no (%d)", signo);
|
sprintf(errstr, "Signal no (%d)", signo);
|
||||||
|
return 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -690,9 +691,6 @@ void make_args( char *argstr, char **tabargv, int *argc, char ***argv )
|
||||||
|
|
||||||
void make_env( lshcontext *context )
|
void make_env( lshcontext *context )
|
||||||
{
|
{
|
||||||
char *buf;
|
|
||||||
short vRefNum;
|
|
||||||
long dirID;
|
|
||||||
StringHandle hstr;
|
StringHandle hstr;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -761,12 +759,12 @@ void *lsh_thread(lshctx *ctx)
|
||||||
context = (lshcontext *)NewPtr(sizeof(lshcontext));
|
context = (lshcontext *)NewPtr(sizeof(lshcontext));
|
||||||
if (context == NULL) {
|
if (context == NULL) {
|
||||||
printf("### main_thread, NewPtr lshcontext failed\n");
|
printf("### main_thread, NewPtr lshcontext failed\n");
|
||||||
return;
|
return 0L;
|
||||||
}
|
}
|
||||||
if (pthread_setspecific(ssh2threadkey, context)) {
|
if (pthread_setspecific(ssh2threadkey, context)) {
|
||||||
printf("### main_thread, pthread_setspecific failed\n");
|
printf("### main_thread, pthread_setspecific failed\n");
|
||||||
DisposePtr((Ptr)context);
|
DisposePtr((Ptr)context);
|
||||||
return;
|
return 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate memory pool */
|
/* allocate memory pool */
|
||||||
|
@ -774,7 +772,7 @@ void *lsh_thread(lshctx *ctx)
|
||||||
if (err != noErr) {
|
if (err != noErr) {
|
||||||
printf("### main_thread, MPInit failed\n");
|
printf("### main_thread, MPInit failed\n");
|
||||||
DisposePtr((Ptr)context);
|
DisposePtr((Ptr)context);
|
||||||
return;
|
return 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
context->_port = -1;
|
context->_port = -1;
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
/*
|
||||||
|
* GUSIPatches.cp
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "lshprefix.h"
|
||||||
|
#include "lsh_context.h"
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <sched.h>
|
||||||
|
|
||||||
|
#include "GUSIMSLSetup.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void ssh2_init();
|
||||||
|
|
||||||
|
void add_one_file(struct lshcontext *context, int fd);
|
||||||
|
void remove_one_file(struct lshcontext *context, int fd);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static void myGusiMSLAddFile(int fd)
|
||||||
|
{
|
||||||
|
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
|
||||||
|
if ( context ) {
|
||||||
|
add_one_file(context, fd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void myGusiMSLRemoveFile(int fd)
|
||||||
|
{
|
||||||
|
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
|
||||||
|
if ( context ) {
|
||||||
|
remove_one_file(context, fd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ssh2_init
|
||||||
|
*/
|
||||||
|
|
||||||
|
void ssh2_init()
|
||||||
|
{
|
||||||
|
static Boolean sGUSISetup = false;
|
||||||
|
|
||||||
|
if ( !sGUSISetup ) {
|
||||||
|
GusiMSLSetAddFile(myGusiMSLAddFile);
|
||||||
|
GusiMSLSetRemoveFile(myGusiMSLRemoveFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue