summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-01-24 15:35:12 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-01-24 15:35:12 +0000
commitc00206c8463e3564bde598f9aa9e8be52b3f27e3 (patch)
tree6246012063f6a44941350e23856e345139b11c5c
parent56e90b21f82f04af4f0a1a957067569857cd0ce2 (diff)
downloadperl-c00206c8463e3564bde598f9aa9e8be52b3f27e3.tar.gz
assorted little nits
p4raw-id: //depot/perl@4882
-rw-r--r--mg.c4
-rw-r--r--win32/Makefile5
-rw-r--r--win32/makefile.mk5
-rw-r--r--win32/perlhost.h9
-rw-r--r--win32/win32.c15
5 files changed, 19 insertions, 19 deletions
diff --git a/mg.c b/mg.c
index fb2b8f173d..4274a20149 100644
--- a/mg.c
+++ b/mg.c
@@ -1238,7 +1238,7 @@ Perl_magic_setpos(pTHX_ SV *sv, MAGIC *mg)
SV* lsv = LvTARG(sv);
SSize_t pos;
STRLEN len;
- STRLEN ulen;
+ STRLEN ulen = 0;
dTHR;
mg = 0;
@@ -1263,8 +1263,6 @@ Perl_magic_setpos(pTHX_ SV *sv, MAGIC *mg)
ulen = sv_len_utf8(lsv);
if (ulen)
len = ulen;
- else
- ulen = 0;
}
if (pos < 0) {
diff --git a/win32/Makefile b/win32/Makefile
index e9e4892d9d..88eb9d80e8 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -428,13 +428,8 @@ $(o).dll:
#
# various targets
-!IF "$(USE_OBJECT)" == "define"
PERLIMPLIB = ..\perl56.lib
PERLDLL = ..\perl56.dll
-!ELSE
-PERLIMPLIB = ..\perl.lib
-PERLDLL = ..\perl.dll
-!ENDIF
MINIPERL = ..\miniperl.exe
MINIDIR = .\mini
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 75f6a5cbe6..9a44722ac3 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -598,13 +598,8 @@ PERL95EXE = ..\perl95.exe
.ENDIF
-.IF "$(USE_OBJECT)" == "define"
PERLIMPLIB *= ..\perl56$(a)
PERLDLL = ..\perl56.dll
-.ELSE
-PERLIMPLIB *= ..\perl$(a)
-PERLDLL = ..\perl.dll
-.ENDIF
XCOPY = xcopy /f /r /i /d
RCOPY = xcopy /f /r /i /e /d
diff --git a/win32/perlhost.h b/win32/perlhost.h
index 93cb4580b0..4b4ad586a4 100644
--- a/win32/perlhost.h
+++ b/win32/perlhost.h
@@ -1628,7 +1628,7 @@ PerlProcSignal(struct IPerlProc* piPerl, int sig, Sighandler_t subcode)
}
#ifdef USE_ITHREADS
-static DWORD WINAPI
+static THREAD_RET_TYPE
win32_start_child(LPVOID arg)
{
PerlInterpreter *my_perl = (PerlInterpreter*)arg;
@@ -1740,9 +1740,14 @@ PerlProcFork(struct IPerlProc* piPerl)
id = win32_start_child((LPVOID)new_perl);
PERL_SET_INTERP(aTHXo);
# else
+# ifdef USE_RTL_THREAD_API
+ handle = (HANDLE)_beginthreadex((void*)NULL, 0, win32_start_child,
+ (void*)new_perl, 0, (unsigned*)&id);
+# else
handle = CreateThread(NULL, 0, win32_start_child,
(LPVOID)new_perl, 0, &id);
- PERL_SET_INTERP(aTHXo);
+# endif
+ PERL_SET_INTERP(aTHXo); /* XXX perl_clone*() set TLS */
if (!handle)
Perl_croak(aTHX_ "panic: pseudo fork() failed");
w32_pseudo_child_handles[w32_num_pseudo_children] = handle;
diff --git a/win32/win32.c b/win32/win32.c
index 710a047cd2..fade1c409d 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -942,9 +942,9 @@ remove_dead_process(long child)
if (child >= 0) {
dTHXo;
CloseHandle(w32_child_handles[child]);
- Copy(&w32_child_handles[child+1], &w32_child_handles[child],
+ Move(&w32_child_handles[child+1], &w32_child_handles[child],
(w32_num_children-child-1), HANDLE);
- Copy(&w32_child_pids[child+1], &w32_child_pids[child],
+ Move(&w32_child_pids[child+1], &w32_child_pids[child],
(w32_num_children-child-1), DWORD);
w32_num_children--;
}
@@ -969,9 +969,9 @@ remove_dead_pseudo_process(long child)
if (child >= 0) {
dTHXo;
CloseHandle(w32_pseudo_child_handles[child]);
- Copy(&w32_pseudo_child_handles[child+1], &w32_pseudo_child_handles[child],
+ Move(&w32_pseudo_child_handles[child+1], &w32_pseudo_child_handles[child],
(w32_num_pseudo_children-child-1), HANDLE);
- Copy(&w32_pseudo_child_pids[child+1], &w32_pseudo_child_pids[child],
+ Move(&w32_pseudo_child_pids[child+1], &w32_pseudo_child_pids[child],
(w32_num_pseudo_children-child-1), DWORD);
w32_num_pseudo_children--;
}
@@ -1397,6 +1397,8 @@ win32_unlink(const char *filename)
A2WHELPER(filename, wBuffer, sizeof(wBuffer));
wcscpy(wBuffer, PerlDir_mapW(wBuffer));
attrs = GetFileAttributesW(wBuffer);
+ if (attrs == 0xFFFFFFFF)
+ goto fail;
if (attrs & FILE_ATTRIBUTE_READONLY) {
(void)SetFileAttributesW(wBuffer, attrs & ~FILE_ATTRIBUTE_READONLY);
ret = _wunlink(wBuffer);
@@ -1409,6 +1411,8 @@ win32_unlink(const char *filename)
else {
filename = PerlDir_mapA(filename);
attrs = GetFileAttributesA(filename);
+ if (attrs == 0xFFFFFFFF)
+ goto fail;
if (attrs & FILE_ATTRIBUTE_READONLY) {
(void)SetFileAttributesA(filename, attrs & ~FILE_ATTRIBUTE_READONLY);
ret = unlink(filename);
@@ -1419,6 +1423,9 @@ win32_unlink(const char *filename)
ret = unlink(filename);
}
return ret;
+fail:
+ errno = ENOENT;
+ return -1;
}
DllExport int