librewolf: update to 134.0-1
[oi-userland.git] / components / desktop / ghex / patches / 01-no-linux-fs.patch
blob4fa252ee8d9cf6312aaeb7a1e74399b7aa4dd375
1 --- ghex-46.1/meson.build.orig
2 +++ ghex-46.1/meson.build
3 @@ -141,7 +141,6 @@
4 'unistd.h',
5 'fcntl.h',
6 'sys/ioctl.h',
7 - 'linux/fs.h',
9 foreach h : check_headers_direct
10 cc.has_header(h, required: true)
11 --- ghex-46.1/src/hex-buffer-direct.h.orig
12 +++ ghex-46.1/src/hex-buffer-direct.h
13 @@ -33,7 +33,13 @@
14 #include <fcntl.h>
15 #include <sys/stat.h>
16 #include <sys/ioctl.h>
17 +#ifdef __linux__
18 #include <linux/fs.h>
19 +#endif
20 +#ifdef __sun__
21 +#include <sys/dkio.h>
22 +#include <sys/vtoc.h>
23 +#endif
25 G_BEGIN_DECLS
27 --- ghex-46.1/src/hex-buffer-direct.c.orig
28 +++ ghex-46.1/src/hex-buffer-direct.c
29 @@ -412,11 +412,23 @@
31 gint64 block_file_size;
33 +#ifdef __linux__
34 if (ioctl (tmp_fd, BLKGETSIZE64, &block_file_size) != 0)
36 set_error (self, _("Error attempting to read block device"));
37 return FALSE;
39 +#endif
40 +#ifdef __sun__
41 + struct dk_minfo dkmp;
43 + if (ioctl (tmp_fd, DKIOCGMEDIAINFO, &dkmp) != 0)
44 + {
45 + set_error (self, _("Error attempting to read block device"));
46 + return FALSE;
47 + }
48 + block_file_size = dkmp.dki_capacity * dkmp.dki_lbsize;
49 +#endif
50 bytes = block_file_size;