nutjunkie / IQmol

IQmol is an open source molecular editor and visualization package
GNU General Public License v3.0
99 stars 47 forks source link

fix sleep function in src/Network/SshReply.C #12

Closed pavel-po closed 8 years ago

pavel-po commented 8 years ago

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;
```

   }
}
nutjunkie commented 8 years ago

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