Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports
Path: blob/main/filesystems/cramfs/files/patch-cramfsck.c
18157 views
1
--- cramfsck.c.orig Wed Nov 29 12:49:40 2006
2
+++ cramfsck.c Wed Nov 29 12:51:12 2006
3
@@ -47,13 +47,14 @@
4
#include <stdlib.h>
5
#include <errno.h>
6
#include <string.h>
7
-#include <sys/sysmacros.h>
8
#include <utime.h>
9
#include <sys/ioctl.h>
10
#define _LINUX_STRING_H_
11
-#include <linux/fs.h>
12
#include <linux/cramfs_fs.h>
13
#include <zlib.h>
14
+
15
+#define BLKGETSIZE _IO(0x12,96)
16
+#define MAP_ANONYMOUS 0x20
17
18
/* Exit codes used by fsck-type programs */
19
#define FSCK_OK 0 /* No errors */
20
@@ -603,8 +603,17 @@
21
}
22
23
if (opt_extract) {
24
- if (mknod(path, i->mode, devtype) < 0) {
25
- die(FSCK_ERROR, 1, "mknod failed: %s", path);
26
+ switch(type) {
27
+ default:
28
+ if (mknod(path, i->mode, devtype) < 0) {
29
+ die(FSCK_ERROR, 1, "mknod failed: %s", path);
30
+ }
31
+ break;
32
+ case 'p':
33
+ if (mkfifo(path, i->mode) < 0) {
34
+ die(FSCK_ERROR, 1, "mkfifo failed: %s", path);
35
+ }
36
+ break;
37
}
38
change_file_status(path, i);
39
}
40
41