mirror of
https://github.com/AltraMayor/f3.git
synced 2025-09-15 01:56:39 -04:00
Fixes for FreeBSD
This commit is contained in:
parent
397648282d
commit
b4e8e6c9da
2
f3read.c
2
f3read.c
@ -1,4 +1,5 @@
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
#define _XOPEN_SOURCE 600
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
@ -10,6 +11,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <err.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
#define _XOPEN_SOURCE 600
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
@ -9,10 +10,10 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/time.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <err.h>
|
||||
#include <alloca.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "utils.h"
|
||||
@ -341,7 +342,7 @@ static int create_and_fill_file(const char *path, long number, size_t size,
|
||||
char *full_fn;
|
||||
const char *filename;
|
||||
int fd, fine;
|
||||
void *buf;
|
||||
char buf[fw->block_size];
|
||||
size_t remaining;
|
||||
uint64_t offset;
|
||||
ssize_t written;
|
||||
@ -366,10 +367,6 @@ static int create_and_fill_file(const char *path, long number, size_t size,
|
||||
}
|
||||
assert(fd >= 0);
|
||||
|
||||
/* Obtain the buffer. */
|
||||
buf = alloca(fw->block_size);
|
||||
assert(buf);
|
||||
|
||||
/* Write content. */
|
||||
fine = 1;
|
||||
offset = (uint64_t)number * GIGABYTES;
|
||||
|
Loading…
x
Reference in New Issue
Block a user