aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-03-06 08:33:14 +0000
committerRon Yorston <rmy@pobox.com>2019-03-06 08:33:14 +0000
commit24b237331a679a2e1d7f80d2b3168622784b084a (patch)
tree44aeb76b0c26b87cda2bee2026aa3b2fde4cb321
parent4ed3d0d07004f3ae7e92b030973a608c5b800d8f (diff)
downloadbusybox-w32-24b237331a679a2e1d7f80d2b3168622784b084a.tar.gz
busybox-w32-24b237331a679a2e1d7f80d2b3168622784b084a.tar.bz2
busybox-w32-24b237331a679a2e1d7f80d2b3168622784b084a.zip
win32: drop argument from err_win_to_posix()
-rw-r--r--include/mingw.h2
-rw-r--r--win32/mingw.c10
-rw-r--r--win32/process.c4
-rw-r--r--win32/statfs.c4
4 files changed, 10 insertions, 10 deletions
diff --git a/include/mingw.h b/include/mingw.h
index f99582ca5..188d4eecf 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -506,7 +506,7 @@ static inline char *auto_win32_extension(const char *p)
506void convert_slashes(char *p) FAST_FUNC; 506void convert_slashes(char *p) FAST_FUNC;
507size_t remove_cr(char *p, size_t len) FAST_FUNC; 507size_t remove_cr(char *p, size_t len) FAST_FUNC;
508 508
509int err_win_to_posix(DWORD winerr); 509int err_win_to_posix(void);
510 510
511ULONGLONG CompatGetTickCount64(void); 511ULONGLONG CompatGetTickCount64(void);
512#define GetTickCount64 CompatGetTickCount64 512#define GetTickCount64 CompatGetTickCount64
diff --git a/win32/mingw.c b/win32/mingw.c
index 11cef0abe..240f87b21 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -28,10 +28,10 @@ unsigned int _CRT_fmode = _O_BINARY;
28 28
29smallint bb_got_signal; 29smallint bb_got_signal;
30 30
31int err_win_to_posix(DWORD winerr) 31int err_win_to_posix(void)
32{ 32{
33 int error = ENOSYS; 33 int error = ENOSYS;
34 switch(winerr) { 34 switch(GetLastError()) {
35 case ERROR_ACCESS_DENIED: error = EACCES; break; 35 case ERROR_ACCESS_DENIED: error = EACCES; break;
36 case ERROR_ACCOUNT_DISABLED: error = EACCES; break; 36 case ERROR_ACCOUNT_DISABLED: error = EACCES; break;
37 case ERROR_ACCOUNT_RESTRICTION: error = EACCES; break; 37 case ERROR_ACCOUNT_RESTRICTION: error = EACCES; break;
@@ -675,7 +675,7 @@ int utimes(const char *file_name, const struct timeval tims[2])
675 fh = CreateFile(file_name, FILE_WRITE_ATTRIBUTES, 0, 675 fh = CreateFile(file_name, FILE_WRITE_ATTRIBUTES, 0,
676 NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); 676 NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
677 if ( fh == INVALID_HANDLE_VALUE ) { 677 if ( fh == INVALID_HANDLE_VALUE ) {
678 errno = err_win_to_posix(GetLastError()); 678 errno = err_win_to_posix();
679 return -1; 679 return -1;
680 } 680 }
681 681
@@ -992,7 +992,7 @@ int link(const char *oldpath, const char *newpath)
992 return -1; 992 return -1;
993 } 993 }
994 if (!CreateHardLinkA(newpath, oldpath, NULL)) { 994 if (!CreateHardLinkA(newpath, oldpath, NULL)) {
995 errno = err_win_to_posix(GetLastError()); 995 errno = err_win_to_posix();
996 return -1; 996 return -1;
997 } 997 }
998 return 0; 998 return 0;
@@ -1021,7 +1021,7 @@ static char *resolve_symlinks(char *path)
1021 } 1021 }
1022 } 1022 }
1023 1023
1024 errno = err_win_to_posix(GetLastError()); 1024 errno = err_win_to_posix();
1025 return NULL; 1025 return NULL;
1026} 1026}
1027 1027
diff --git a/win32/process.c b/win32/process.c
index 33ae13ab4..d0fcc1c80 100644
--- a/win32/process.c
+++ b/win32/process.c
@@ -590,7 +590,7 @@ static int kill_pids(pid_t pid, int exit_code, kill_callback killer)
590 HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); 590 HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
591 591
592 if (snapshot == INVALID_HANDLE_VALUE) { 592 if (snapshot == INVALID_HANDLE_VALUE) {
593 errno = err_win_to_posix(GetLastError()); 593 errno = err_win_to_posix();
594 return -1; 594 return -1;
595 } 595 }
596 596
@@ -623,7 +623,7 @@ static int kill_pids(pid_t pid, int exit_code, kill_callback killer)
623 for (i = len - 1; i >= 0; i--) { 623 for (i = len - 1; i >= 0; i--) {
624 SetLastError(0); 624 SetLastError(0);
625 if (killer(pids[i], exit_code)) { 625 if (killer(pids[i], exit_code)) {
626 errno = err_win_to_posix(GetLastError()); 626 errno = err_win_to_posix();
627 ret = -1; 627 ret = -1;
628 } 628 }
629 } 629 }
diff --git a/win32/statfs.c b/win32/statfs.c
index 4e5e4612d..d81a69380 100644
--- a/win32/statfs.c
+++ b/win32/statfs.c
@@ -21,13 +21,13 @@ int statfs(const char *file, struct statfs *buf)
21 if ( !GetDiskFreeSpaceEx(file, (PULARGE_INTEGER) &free_bytes_available, 21 if ( !GetDiskFreeSpaceEx(file, (PULARGE_INTEGER) &free_bytes_available,
22 (PULARGE_INTEGER) &total_number_of_bytes, 22 (PULARGE_INTEGER) &total_number_of_bytes,
23 (PULARGE_INTEGER) &total_number_of_free_bytes) ) { 23 (PULARGE_INTEGER) &total_number_of_free_bytes) ) {
24 errno = err_win_to_posix(GetLastError()); 24 errno = err_win_to_posix();
25 return -1; 25 return -1;
26 } 26 }
27 27
28 if ( !GetVolumeInformation(file, NULL, 0, &serial, &namelen, &flags, 28 if ( !GetVolumeInformation(file, NULL, 0, &serial, &namelen, &flags,
29 fsname, 100) ) { 29 fsname, 100) ) {
30 errno = err_win_to_posix(GetLastError()); 30 errno = err_win_to_posix();
31 return -1; 31 return -1;
32 } 32 }
33 33