nutjunkie/IQmol

fix sleep function in src/Network/SshReply.C

Closed this issue · 1 comments

I can compile this code only by adding header unistd.h and replacing sleep(int) by usleep(int):


void SshTest::runDelegate()
{
   for (int i = 0; i < 10; ++i) {
      QLOG_TRACE() << "Running thread" << m_id << i;
# ifdef WIN32

```
  Sleep(2000);
```
# else

```
  //sleep(2);
  usleep(2);
```
# endif

```
  if (m_interrupt) break;
```

   }
}

Both sleep and usleep should be defined in unistd.h: http://pubs.opengroup.org/onlinepubs/7908799/xsh/unistd.h.html