From 70185fdcc22e2cd11ee5d6171395f3c223bc21e6 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Mon, 11 Feb 2013 23:27:12 -0500 Subject: rt: remove last_os_error and adjust tests. --- src/rt/rust_builtin.cpp | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'src/rt') 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(); -- cgit 1.4.1-3-g733a5 From 2180fe25520727a747c5a73b4d582a120ad116bd Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Tue, 12 Feb 2013 00:22:58 -0500 Subject: rt: remove last_os_error from rustrt.def.in --- src/rt/rustrt.def.in | 1 - 1 file changed, 1 deletion(-) (limited to 'src/rt') diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index 2e687472a8d..b49aa89b6c8 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -14,7 +14,6 @@ rust_gmtime rust_localtime rust_timegm rust_mktime -last_os_error new_task precise_time_ns rand_free -- cgit 1.4.1-3-g733a5