comparison freeDiameter/tests/testsess.c @ 249:6e6ada749a11

Replaced clock_nanosleep since it is missing on FreeBSD platform
author Sebastien Decugis <sdecugis@nict.go.jp>
date Fri, 02 Apr 2010 15:55:26 +0900
parents b0d377c79d80
children 5df55136361b
comparison
equal deleted inserted replaced
248:d3e892306468 249:6e6ada749a11
210 210
211 CHECK( 0, clock_gettime(CLOCK_REALTIME, &timeout) ); 211 CHECK( 0, clock_gettime(CLOCK_REALTIME, &timeout) );
212 CHECK( 0, fd_sess_settimeout( sess1, &timeout) ); 212 CHECK( 0, fd_sess_settimeout( sess1, &timeout) );
213 timeout.tv_sec = 0; 213 timeout.tv_sec = 0;
214 timeout.tv_nsec= 50000000; /* 50 ms */ 214 timeout.tv_nsec= 50000000; /* 50 ms */
215 CHECK( 0, clock_nanosleep(CLOCK_REALTIME, 0, &timeout, NULL) ); 215 CHECK( 0, nanosleep(&timeout, NULL) );
216 216
217 CHECK( 0, fd_sess_fromsid( TEST_SID, strlen(TEST_SID), &sess1, &new ) ); 217 CHECK( 0, fd_sess_fromsid( TEST_SID, strlen(TEST_SID), &sess1, &new ) );
218 CHECK( 1, new ? 1 : 0 ); 218 CHECK( 1, new ? 1 : 0 );
219 219
220 CHECK( 0, clock_gettime(CLOCK_REALTIME, &timeout) ); 220 CHECK( 0, clock_gettime(CLOCK_REALTIME, &timeout) );
336 fd_sess_dump(0, sess1); 336 fd_sess_dump(0, sess1);
337 fd_sess_dump(0, sess2); 337 fd_sess_dump(0, sess2);
338 #endif 338 #endif
339 timeout.tv_sec = 0; 339 timeout.tv_sec = 0;
340 timeout.tv_nsec= 50000000; /* 50 ms */ 340 timeout.tv_nsec= 50000000; /* 50 ms */
341 CHECK( 0, clock_nanosleep(CLOCK_REALTIME, 0, &timeout, NULL) ); 341 CHECK( 0, nanosleep(&timeout, NULL) );
342 CHECK( 0, freed[0] ); 342 CHECK( 0, freed[0] );
343 CHECK( 1, freed[1] ); 343 CHECK( 1, freed[1] );
344 CHECK( 1, freed[2] ); 344 CHECK( 1, freed[2] );
345 CHECK( 1, freed[3] ); 345 CHECK( 1, freed[3] );
346 CHECK( 1, freed[4] ); 346 CHECK( 1, freed[4] );
"Welcome to our mercurial repository"