diff options
| author | Luqman Aden <laden@csclub.uwaterloo.ca> | 2013-02-11 23:27:12 -0500 |
|---|---|---|
| committer | Luqman Aden <laden@csclub.uwaterloo.ca> | 2013-02-11 23:49:49 -0500 |
| commit | 70185fdcc22e2cd11ee5d6171395f3c223bc21e6 (patch) | |
| tree | c0accf6f275aa63a08f73df82c7146590d5e54f2 /src/rt/rust_builtin.cpp | |
| parent | 625fac3c7eea1d28a38f0636b100b60dd4be15aa (diff) | |
| download | rust-70185fdcc22e2cd11ee5d6171395f3c223bc21e6.tar.gz rust-70185fdcc22e2cd11ee5d6171395f3c223bc21e6.zip | |
rt: remove last_os_error and adjust tests.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index e14f62ffae9..24d7a5b287a 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -52,50 +52,6 @@ timegm(struct tm *tm) } #endif - -extern "C" CDECL rust_str* -last_os_error() { - rust_task *task = rust_get_current_task(); - - LOG(task, task, "last_os_error()"); - -#if defined(__WIN32__) - LPTSTR buf; - DWORD err = GetLastError(); - DWORD res = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, err, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &buf, 0, NULL); - if (!res) { - task->fail(); - return NULL; - } -#elif defined(_GNU_SOURCE) && !defined(__ANDROID__) - char cbuf[BUF_BYTES]; - char *buf = strerror_r(errno, cbuf, sizeof(cbuf)); - if (!buf) { - task->fail(); - return NULL; - } -#else - char buf[BUF_BYTES]; - int err = strerror_r(errno, buf, sizeof(buf)); - if (err) { - task->fail(); - return NULL; - } -#endif - - rust_str * st = make_str(task->kernel, buf, strlen(buf), - "last_os_error"); -#ifdef __WIN32__ - LocalFree((HLOCAL)buf); -#endif - return st; -} - extern "C" CDECL rust_str * rust_getcwd() { rust_task *task = rust_get_current_task(); |
