Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
f0f02ba1
Commit
f0f02ba1
authored
Aug 14, 2012
by
Pieter Noordhuis
Browse files
POSIX.1-2001 declares usleep obsolete; use nanosleep
parent
4e9221f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/spawn.c
View file @
f0f02ba1
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
#include <string.h>
#include <string.h>
#include <sys/types.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
#include <unistd.h>
#include "spawn.h"
#include "spawn.h"
...
@@ -59,6 +60,11 @@ void spawn(spawn_function *fn, void *ptr) {
...
@@ -59,6 +60,11 @@ void spawn(spawn_function *fn, void *ptr) {
exit
(
0
);
exit
(
0
);
}
}
struct
timespec
ts
;
ts
.
tv_sec
=
0
;
ts
.
tv_nsec
=
1000
*
1000
;
/* Give the fork some time to boot... */
/* Give the fork some time to boot... */
u
sleep
(
1000
);
nano
sleep
(
&
ts
,
NULL
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment