X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=NetWare%2FNwmain.c;h=219ab6cd7a5b17f49b6dfe966c97360be57ecae8;hb=9a473428524fe6f52bcc04776c71cff87d1505ca;hp=a01fa5efdd006b473211d8f181883df4e8e4ed14;hpb=2986a63f7e513cf37f46db9f211b77071260031f;p=p5sagit%2Fp5-mst-13.2.git diff --git a/NetWare/Nwmain.c b/NetWare/Nwmain.c index a01fa5e..219ab6c 100644 --- a/NetWare/Nwmain.c +++ b/NetWare/Nwmain.c @@ -119,7 +119,11 @@ int fnFpSetMode(FILE* fp, int mode, int *err); void fnGetPerlScreenName(char *sPerlScreenName); - +void fnGetPerlScreenName(char *sPerlScreenName); +void fnSetupNamespace(void); +char *getcwd(char [], int); +void fnRunScript(ScriptData* psdata); +void nw_freeenviron(); /*============================================================================================ @@ -160,8 +164,8 @@ void main(int argc, char *argv[]) // Ensure that we have a "temp" directory fnSetupNamespace(); - if (access(DEFTEMP, 0) != 0) - mkdir(DEFTEMP); + if (access(NWDEFPERLTEMP, 0) != 0) + mkdir(NWDEFPERLTEMP); // Create the file NUL if not present. This is done only once per NLM load. // This is required for -e. @@ -176,8 +180,8 @@ void main(int argc, char *argv[]) { char sNUL[MAX_DN_BYTES] = {'\0'}; - strcpy(sNUL, DEFPERLROOT); - strcat(sNUL, "\\nul"); + strcpy(sNUL, NWDEFPERLROOT); + strcat(sNUL, "\\nwnul"); if (access((const char *)sNUL, 0) != 0) { // The file, "nul" is not found and so create the file. @@ -299,7 +303,7 @@ void fnSigTermHandler(int sig) // while (!fnTerminateThreadInfo() && k < 5) { - sleep(1); + nw_sleep(1); k++; } } @@ -308,8 +312,8 @@ void fnSigTermHandler(int sig) { char sNUL[MAX_DN_BYTES] = {'\0'}; - strcpy(sNUL, DEFPERLROOT); - strcat(sNUL, "\\nul"); + strcpy(sNUL, NWDEFPERLROOT); + strcat(sNUL, "\\nwnul"); if (access((const char *)sNUL, 0) == 0) { // The file, "nul" is found and so delete it. @@ -530,7 +534,7 @@ void fnLaunchPerl(void* context) { // get the default working directory name // - defaultDir = fnNwGetEnvironmentStr("PERL_ROOT", DEFPERLROOT); + defaultDir = fnNwGetEnvironmentStr("PERL_ROOT", NWDEFPERLROOT); } else defaultDir = getcwd(curdir, sizeof(curdir)-1); @@ -1386,10 +1390,8 @@ char *** nw_getenviron() { if (genviron) - // This (and not the next line) is the correct operation since it matches with the return type. - // But it is leaking memory upto 11736 bytes!! So it is commented. -// return (&genviron); - return genviron; + return (&genviron); // This might leak memory upto 11736 bytes on some versions of NetWare. +// return genviron; // Abending on some versions of NetWare. else fnSetUpEnvBlock(&genviron);