Skip to content
Permalink
Browse files

process, feat: clean up the terminal when exiting the process.

  • Loading branch information...
xicilion committed Jul 2, 2019
1 parent abf7897 commit 34b7e615016b64df6f30830f79be5e62c5fa8555
Showing with 8 additions and 5 deletions.
  1. +8 −5 fibjs/src/process/process.cpp
@@ -27,6 +27,8 @@

#else

#include "editline/include/editline.h"

inline int32_t _umask(int32_t m)
{
return ::umask(m);
@@ -222,11 +224,11 @@ result_t process_base::get_platform(exlib::string& retVal)

result_t process_base::get_pid(int32_t& retVal)
{
#ifdef _WIN32
retVal = GetCurrentProcessId();
#else
retVal = getpid();
#endif
#ifdef _WIN32
retVal = GetCurrentProcessId();
#else
retVal = getpid();
#endif

return 0;
}
@@ -285,6 +287,7 @@ result_t process_base::exit()
#ifdef _WIN32
TerminateProcess(GetCurrentProcess(), code);
#else
rl_deprep_terminal();
::_exit(code);
#endif

0 comments on commit 34b7e61

Please sign in to comment.
You can’t perform that action at this time.