mirror of
https://github.com/linux-can/can-utils.git
synced 2026-09-22 08:06:34 +02:00
convert usleep to nanosleep
usleep is removed in POSIX 2008. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
+5
-1
@@ -281,8 +281,12 @@ int main(int argc, char **argv)
|
||||
inaddr.sin_port = htons(port);
|
||||
|
||||
while(bind(socki, (struct sockaddr*)&inaddr, sizeof(inaddr)) < 0) {
|
||||
struct timespec f = {
|
||||
.tv_nsec = 100 * 1000 * 1000,
|
||||
};
|
||||
|
||||
printf(".");fflush(NULL);
|
||||
usleep(100000);
|
||||
nanosleep(&f, NULL);
|
||||
}
|
||||
|
||||
if (listen(socki, 3) != 0) {
|
||||
|
||||
Reference in New Issue
Block a user