MacCvs changes

This commit is contained in:
aubonbeurre 2001-03-15 04:44:31 +00:00
parent 38d6af1704
commit 4d2942dc7c
4 changed files with 59 additions and 6 deletions

BIN
lsh/MacOS/lshmaccvs.mcp Normal file

Binary file not shown.

View File

@ -323,6 +323,7 @@ char * strsignal(int signo)
static char errstr[__max_errstr];
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 )
{
char *buf;
short vRefNum;
long dirID;
StringHandle hstr;
int i;
@ -761,12 +759,12 @@ void *lsh_thread(lshctx *ctx)
context = (lshcontext *)NewPtr(sizeof(lshcontext));
if (context == NULL) {
printf("### main_thread, NewPtr lshcontext failed\n");
return;
return 0L;
}
if (pthread_setspecific(ssh2threadkey, context)) {
printf("### main_thread, pthread_setspecific failed\n");
DisposePtr((Ptr)context);
return;
return 0L;
}
/* allocate memory pool */
@ -774,7 +772,7 @@ void *lsh_thread(lshctx *ctx)
if (err != noErr) {
printf("### main_thread, MPInit failed\n");
DisposePtr((Ptr)context);
return;
return 0L;
}
context->_port = -1;

View File

@ -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.