From: Gurusamy Sarathy Date: Wed, 3 Jun 1998 22:12:55 +0000 (+0000) Subject: [win32] add AS patch#24, remove one other instance of error_no X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5a0924038aa1098308ad491a6148bc59d3045ce6;p=p5sagit%2Fp5-mst-13.2.git [win32] add AS patch#24, remove one other instance of error_no that was missed (patch#23 was intentionally skipped) p4raw-id: //depot/win32/perl@1071 --- diff --git a/embedvar.h b/embedvar.h index a74b4e4..6cb5972 100644 --- a/embedvar.h +++ b/embedvar.h @@ -782,7 +782,6 @@ #define do_undump (Perl_Vars.Gdo_undump) #define egid (Perl_Vars.Gegid) #define error_count (Perl_Vars.Gerror_count) -#define error_no (Perl_Vars.Gerror_no) #define euid (Perl_Vars.Geuid) #define eval_cond (Perl_Vars.Geval_cond) #define eval_mutex (Perl_Vars.Geval_mutex) @@ -902,7 +901,6 @@ #define Gdo_undump do_undump #define Gegid egid #define Gerror_count error_count -#define Gerror_no error_no #define Geuid euid #define Geval_cond eval_cond #define Geval_mutex eval_mutex @@ -1022,7 +1020,6 @@ #define do_undump Perl_do_undump #define egid Perl_egid #define error_count Perl_error_count -#define error_no Perl_error_no #define euid Perl_euid #define eval_cond Perl_eval_cond #define eval_mutex Perl_eval_mutex diff --git a/globals.c b/globals.c index 1fd3f1e..1daf4f1 100644 --- a/globals.c +++ b/globals.c @@ -1438,7 +1438,7 @@ CPerlObj::operator new(size_t nSize, IPerlMem *pvtbl) int& CPerlObj::ErrorNo(void) { - return error_no; + return errno; } void diff --git a/perlvars.h b/perlvars.h index 9f801fb..954a99f 100644 --- a/perlvars.h +++ b/perlvars.h @@ -25,11 +25,6 @@ PERLVARI(Gthreadsv_names, char *, THREADSV_NAMES) PERLVAR(Gcurthr, struct perl_thread *) /* Currently executing (fake) thread */ #endif #endif /* USE_THREADS */ -#ifdef PERL_OBJECT -#ifdef WIN32 -PERLVAR(Gerror_no, int) /* errno for each interpreter */ -#endif -#endif PERLVAR(Guid, int) /* current real user id */ PERLVAR(Geuid, int) /* current effective user id */ diff --git a/win32/makedef.pl b/win32/makedef.pl index 1b45f73..237c950 100644 --- a/win32/makedef.pl +++ b/win32/makedef.pl @@ -112,7 +112,6 @@ Perl_dump_packsubs Perl_dump_pm Perl_dump_sub Perl_expectterm -Perl_error_no Perl_extralen Perl_fetch_gv Perl_fetch_io diff --git a/win32/runperl.c b/win32/runperl.c index 36461bd..17d2ac2 100644 --- a/win32/runperl.c +++ b/win32/runperl.c @@ -23,6 +23,12 @@ CPerlObj *pPerl; #include #include +#define CALLFUNC0RET(x)\ + int ret = x;\ + if(ret < 0)\ + err = errno;\ + return ret; + extern int g_closedir(DIR *dirp); extern DIR *g_opendir(char *filename); extern struct direct *g_readdir(DIR *dirp); @@ -35,15 +41,15 @@ public: CPerlDir() {}; virtual int Makedir(const char *dirname, int mode, int &err) { - return win32_mkdir(dirname, mode); + CALLFUNC0RET(win32_mkdir(dirname, mode)); }; virtual int Chdir(const char *dirname, int &err) { - return win32_chdir(dirname); + CALLFUNC0RET(win32_chdir(dirname)); }; virtual int Rmdir(const char *dirname, int &err) { - return win32_rmdir(dirname); + CALLFUNC0RET(win32_rmdir(dirname)); }; virtual int Close(DIR *dirp, int &err) {