mirror of
https://github.com/void-linux/void-packages.git
synced 2025-10-01 08:05:09 +02:00
43 lines
1.2 KiB
Diff
43 lines
1.2 KiB
Diff
--- utils.c 2015-11-20 01:15:32.227019383 +0100
|
|
+++ utils.c 2015-11-20 01:16:59.419971215 +0100
|
|
@@ -1208,13 +1208,19 @@ static int resolve_loop_device(const cha
|
|
{
|
|
int ret;
|
|
FILE *f;
|
|
+ struct stat stat_buf;
|
|
char fmt[20];
|
|
char p[PATH_MAX];
|
|
char real_loop_dev[PATH_MAX];
|
|
|
|
if (!realpath(loop_dev, real_loop_dev))
|
|
return -errno;
|
|
- snprintf(p, PATH_MAX, "/sys/block/%s/loop/backing_file", strrchr(real_loop_dev, '/'));
|
|
+
|
|
+ if (stat(real_loop_dev, &stat_buf) || !S_ISBLK(stat_buf.st_mode))
|
|
+ return -errno;
|
|
+
|
|
+ snprintf(p, PATH_MAX, "/sys/dev/block/%d:%d/loop/backing_file",
|
|
+ major(stat_buf.st_rdev), minor(stat_buf.st_rdev));
|
|
if (!(f = fopen(p, "r"))) {
|
|
if (errno == ENOENT)
|
|
/*
|
|
--- mkfs/common.c.orig 2017-03-08 13:23:24.000000000 +0000
|
|
+++ mkfs/common.c 2017-03-09 06:24:26.356552024 +0000
|
|
@@ -18,6 +18,7 @@
|
|
#include <uuid/uuid.h>
|
|
#include <blkid/blkid.h>
|
|
#include <fcntl.h>
|
|
+#include <limits.h>
|
|
#include "ctree.h"
|
|
#include "disk-io.h"
|
|
#include "volumes.h"
|
|
--- convert/source-ext2.c.orig 2017-03-08 13:23:24.000000000 +0000
|
|
+++ convert/source-ext2.c 2017-03-09 06:27:45.991562323 +0000
|
|
@@ -16,6 +16,7 @@
|
|
|
|
#if BTRFSCONVERT_EXT2
|
|
|
|
+#include <linux/limits.h>
|
|
#include "kerncompat.h"
|
|
#include "disk-io.h"
|
|
#include "transaction.h"
|