#include <TargetConditionals.h>
-#if !TARGET_OS_EMBEDDED
+#if !TARGET_OS_IPHONE
#include <sys/fcntl.h>
#include <sys/types.h>
.l2p_contigbytes = 1024 * 1024,
.l2p_devoffset = len - 1,
};
-
if (fcntl(fd, F_LOG2PHYS_EXT, &l2p)) {
if (errno == ERANGE)
break;
{
di = disk_image_get();
- int fd = make_frag_file(1);
+ int frag_fd = make_frag_file(1);
+ int fd;
+ int fd2;
struct stat sb;
- fstat(fd, &sb);
+ fstat(frag_fd, &sb);
- int fd2;
asprintf(&file2, "%s/move_data_extents.2", di->mount_point);
assert_with_errno((fd2 = open(file2,
#define F_MOVEDATAEXTENTS 69
- assert_no_err(fcntl(fd, F_MOVEDATAEXTENTS, fd2));
+ assert_no_err(fcntl(frag_fd, F_MOVEDATAEXTENTS, fd2));
char buf[4096];
check_io(pread(fd2, buf, 4096, sb.st_size - 4096), 4096);
pthread_join(thread, NULL);
close(fd);
+ close(frag_fd);
/*
* Make sure that the extents from move_data_extents.1 got deleted
assert_no_err(unlink(file2));
+ assert_no_err (close(fd));
+ assert_no_err (close(fd2));
+ assert_no_err (close(fd3));
+
free(file1);
free(file2);
free(file3);
return 0;
}
-#endif
+#endif // !TARGET_OS_IPHONE