diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-24 15:35:12 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-24 15:35:12 +0000 |
commit | c00206c8463e3564bde598f9aa9e8be52b3f27e3 (patch) | |
tree | 6246012063f6a44941350e23856e345139b11c5c /win32/win32.c | |
parent | 56e90b21f82f04af4f0a1a957067569857cd0ce2 (diff) | |
download | perl-c00206c8463e3564bde598f9aa9e8be52b3f27e3.tar.gz |
assorted little nits
p4raw-id: //depot/perl@4882
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 15 |
1 files changed, 11 insertions, 4 deletions
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 |