summaryrefslogtreecommitdiff
path: root/app-emulation/guestfs-tools/files/guestfs-tools-1.55.6-common-support-ocaml-4.14.2.patch
blob: c7560c6679177dad358b17eab04ac3381fcd2de2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
diff --git a/common/mlcustomize/crypt-c.c b/common/mlcustomize/crypt-c.c
index e1bc740..e358018 100644
--- a/common/mlcustomize/crypt-c.c
+++ b/common/mlcustomize/crypt-c.c
@@ -47,7 +47,7 @@ virt_customize_crypt (value keyv, value saltv)
    */
   r = crypt (String_val (keyv), String_val (saltv));
   if (r == NULL)
-    caml_unix_error (errno, (char *) "crypt", Nothing);
+    unix_error (errno, (char *) "crypt", Nothing);
   rv = caml_copy_string (r);
 
   CAMLreturn (rv);
diff --git a/common/mltools/tools_utils-c.c b/common/mltools/tools_utils-c.c
index 21f7469..4ff42e5 100644
--- a/common/mltools/tools_utils-c.c
+++ b/common/mltools/tools_utils-c.c
@@ -126,10 +126,10 @@ guestfs_int_mllib_rfc3339_date_time_string (value unitv)
   size_t total = 0;
 
   if (clock_gettime (CLOCK_REALTIME, &ts) == -1)
-    caml_unix_error (errno, (char *) "clock_gettime", Val_unit);
+    unix_error (errno, (char *) "clock_gettime", Val_unit);
 
   if (localtime_r (&ts.tv_sec, &tm) == NULL)
-    caml_unix_error (errno, (char *) "localtime_r", caml_copy_int64 (ts.tv_sec));
+    unix_error (errno, (char *) "localtime_r", caml_copy_int64 (ts.tv_sec));
 
   /* Sadly strftime does not support nanoseconds, so what we do is:
    * - stringify everything before the nanoseconds
@@ -141,17 +141,17 @@ guestfs_int_mllib_rfc3339_date_time_string (value unitv)
 
   ret = strftime (buf, sizeof (buf), "%Y-%m-%dT%H:%M:%S.", &tm);
   if (ret == 0)
-    caml_unix_error (errno, (char *) "strftime", Val_unit);
+    unix_error (errno, (char *) "strftime", Val_unit);
   total += ret;
 
   ret = snprintf (buf + total, sizeof (buf) - total, "%09ld", ts.tv_nsec);
   if (ret == 0)
-    caml_unix_error (errno, (char *) "sprintf", caml_copy_int64 (ts.tv_nsec));
+    unix_error (errno, (char *) "sprintf", caml_copy_int64 (ts.tv_nsec));
   total += ret;
 
   ret = strftime (buf + total, sizeof (buf) - total, "%z", &tm);
   if (ret == 0)
-    caml_unix_error (errno, (char *) "strftime", Val_unit);
+    unix_error (errno, (char *) "strftime", Val_unit);
   total += ret;
 
   /* Move the timezone minutes one character to the right, moving the
diff --git a/common/mlutils/c_utils-c.c b/common/mlutils/c_utils-c.c
index f0e2798..54791ec 100644
--- a/common/mlutils/c_utils-c.c
+++ b/common/mlutils/c_utils-c.c
@@ -68,7 +68,7 @@ guestfs_int_mlutils_shell_unquote (value strv)
 
   ret = guestfs_int_shell_unquote (String_val (strv));
   if (ret == NULL)
-    caml_unix_error (errno, (char *) "guestfs_int_shell_unquote", Nothing);
+    unix_error (errno, (char *) "guestfs_int_shell_unquote", Nothing);
 
   retv = caml_copy_string (ret);
   free (ret);
@@ -102,7 +102,7 @@ guestfs_int_mlutils_full_path (value dirv, value namev)
 
   ret = guestfs_int_full_path (String_val (dirv), name);
   if (ret == NULL)
-    caml_unix_error (errno, (char *) "guestfs_int_full_path", dirv);
+    unix_error (errno, (char *) "guestfs_int_full_path", dirv);
   rv = caml_copy_string (ret);
   free (ret);
 
diff --git a/common/mlutils/unix_utils-c.c b/common/mlutils/unix_utils-c.c
index 919f526..b6ad832 100644
--- a/common/mlutils/unix_utils-c.c
+++ b/common/mlutils/unix_utils-c.c
@@ -149,7 +149,7 @@ guestfs_int_mllib_fnmatch (value patternv, value strv, value flagsv)
     /* XXX The fnmatch specification doesn't mention what errors can
      * be returned by fnmatch.  Assume they are errnos for now.
      */
-    caml_unix_error (errno, (char *) "fnmatch", patternv);
+    unix_error (errno, (char *) "fnmatch", patternv);
   }
 }
 
@@ -182,16 +182,16 @@ guestfs_int_mllib_fsync_file (value filenamev)
   /* Note to do fsync you have to open for write. */
   fd = open (filename, O_RDWR);
   if (fd == -1)
-    caml_unix_error (errno, (char *) "open", filenamev);
+    unix_error (errno, (char *) "open", filenamev);
 
   if (fsync (fd) == -1) {
     err = errno;
     close (fd);
-    caml_unix_error (err, (char *) "fsync", filenamev);
+    unix_error (err, (char *) "fsync", filenamev);
   }
 
   if (close (fd) == -1)
-    caml_unix_error (errno, (char *) "close", filenamev);
+    unix_error (errno, (char *) "close", filenamev);
 
   CAMLreturn (Val_unit);
 }
@@ -205,13 +205,13 @@ guestfs_int_mllib_mkdtemp (value val_pattern)
 
   pattern = strdup (String_val (val_pattern));
   if (pattern == NULL)
-    caml_unix_error (errno, (char *) "strdup", val_pattern);
+    unix_error (errno, (char *) "strdup", val_pattern);
 
   ret = mkdtemp (pattern);
   if (ret == NULL) {
     int err = errno;
     free (pattern);
-    caml_unix_error (err, (char *) "mkdtemp", val_pattern);
+    unix_error (err, (char *) "mkdtemp", val_pattern);
   }
 
   rv = caml_copy_string (ret);
@@ -229,7 +229,7 @@ guestfs_int_mllib_realpath (value pathv)
 
   r = realpath (String_val (pathv), NULL);
   if (r == NULL)
-    caml_unix_error (errno, (char *) "realpath", pathv);
+    unix_error (errno, (char *) "realpath", pathv);
 
   rv = caml_copy_string (r);
   free (r);
@@ -257,7 +257,7 @@ guestfs_int_mllib_statvfs_statvfs (value pathv)
   struct statvfs buf;
 
   if (statvfs (String_val (pathv), &buf) == -1)
-    caml_unix_error (errno, (char *) "statvfs", pathv);
+    unix_error (errno, (char *) "statvfs", pathv);
 
   f_bsize = buf.f_bsize;
   f_frsize = buf.f_frsize;
@@ -281,7 +281,7 @@ guestfs_int_mllib_statvfs_statvfs (value pathv)
                            (PULARGE_INTEGER) &free_bytes_available,
                            (PULARGE_INTEGER) &total_number_of_bytes,
                            (PULARGE_INTEGER) &total_number_of_free_bytes))
-    caml_unix_error (EIO, (char *) "statvfs: GetDiskFreeSpaceEx", pathv);
+    unix_error (EIO, (char *) "statvfs: GetDiskFreeSpaceEx", pathv);
 
   /* XXX I couldn't determine how to get block size.  MSDN has a
    * unhelpful hard-coded list here:
@@ -356,7 +356,7 @@ guestfs_int_mllib_statvfs_is_network_filesystem (value pathv)
   struct statfs buf;
 
   if (statfs (String_val (pathv), &buf) == -1)
-    caml_unix_error (errno, (char *) "statvfs", pathv);
+    unix_error (errno, (char *) "statvfs", pathv);
 
   /* Some but not all of these are defined in <linux/magic.h>. */
 #ifndef CIFS_MAGIC_NUMBER