commit - 2c2a629300a971043a6fc54136a390d26e2e9ee6
commit + 71bf58261180540753b6cdd0bcbf2853f2152f1f
blob - 34735651bf862c735090f4a6682c53469d6466e6
blob + a126bcfcaf9cc7b1530ccc8a71bd68630f0e36d4
--- mc5000.c
+++ mc5000.c
*/
#include <assert.h>
+#include <errno.h>
#include <stdio.h>
#include <stdint.h> /* uint8_t */
#include <stdlib.h> /* exit */
fputc(x, f);
if (f == devf) {
- struct timespec ts = {0, 10 * 100000L}; /* 10 ms */
- nanosleep(&ts, NULL); // XXX could be interrupted
+ struct timespec ts = {0, 10 * 1000000L}; /* 10 ms */
+ while (nanosleep(&ts, &ts) == -1)
+ if (errno != EINTR)
+ err(1, "nanosleep");
}
}