The code was not compiling when mode was not passed to open()
while using O_CREAT offset. Passed mode to the open() alongwith
O_CREAT to specify the attributes of file and fix compile issue.
Signed-off-by: Ammar Zahid Ali Syed <ammar.zhd@googlemail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
#include <stdbool.h>
#include <getopt.h>
#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#define __force
#define __bitwise
#define __user
if (verbose)
printf("%s: entry, reading %u bytes\n", __func__, length);
- file = open(name, O_RDWR | O_CREAT);
+ file = open(name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
if (file == -1) {
fprintf(stderr, "Unable to open file '%s'\n", name);
exit(EXIT_FAILURE);