* vim:expandtab:shiftwidth=8:tabstop=8:
*/
+/* for O_DIRECT */
+#define _GNU_SOURCE
+
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
-#include <linux/lustre_lite.h>
-
-#ifndef O_DIRECT
-# define O_DIRECT 040000 /* direct disk access hint */
-#endif
+#include <linux/lustre_user.h>
int main(int argc, char *argv[])
{
pid_t ret;
ret = waitpid(0, &status, 0);
- if (ret == 0) {
+ if (ret == 0)
continue;
- }
if (ret < 0) {
fprintf(stderr, "error: %s: wait - %s\n",
argv[0], ret, err);
if (!rc)
rc = err;
-
- live_threads--;
}
+ live_threads--;
}
} else {
if (threads)
rc = errno;
break;
}
- if (ioctl(fd, LL_IOC_SETFLAGS, &ioctl_flags) < 0) {
+ if (ioctl(fd, LL_IOC_SETFLAGS, &ioctl_flags) < 0 &&
+ errno != ENOTTY) {
fprintf(stderr, "ioctl(): %s\n",
strerror(errno));
rc = errno;