Skip to contentSkip to conversation

Include fcntl.h for O_EXCL

PATCH In review Khem Raj 2 participants 7 messages Sep 10, 2017

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/5 Include fcntl.h for O_EXCL

Fix
error: 'O_CREAT' undeclared (first use in this function)

---
 invutil/invidx.c | 1 +
 1 file changed, 1 insertion(+)
invutil/invidx.c +1 -0
index 67efdf7..325a9a1 100644
@@ -27,6 +27,7 @@
 #include <sys/stat.h>
 #include <string.h>
 #include <uuid/uuid.h>
+#include <fcntl.h>
 
 #include "types.h"
 #include "mlog.h"
Signature · 1 line
2.14.1
author
#1 lore raw

PATCH 2/5 xfsdump: Use c99 defined [u]int*_t instead of double underscore integer types

Purely a mechanical change

---
 common/content_inode.h | 4 ++--
 common/hsmapi.c        | 2 +-
 doc/xfsdump.html       | 8 ++++----
 inventory/inv_oref.h   | 2 +-
 inventory/inv_priv.h   | 4 ++--
 inventory/inventory.h  | 2 +-
 6 files changed, 11 insertions(+), 11 deletions(-)
common/content_inode.h +2 -2
index a69a9a0..6936e05 100644
@@ -191,10 +191,10 @@ typedef struct bstat bstat_t;
  * and using two 16bit values to hold new 32bit projid was choosen
  * to retain compatibility with "old" filesystems).
  */
-static inline __uint32_t
+static inline uint32_t
 bstat_projid(struct bstat *bs)
 {
-        return (__uint32_t)bs->bs_projid_hi << 16 | bs->bs_projid_lo;
+        return (uint32_t)bs->bs_projid_hi << 16 | bs->bs_projid_lo;
 }
 
 
common/hsmapi.c +1 -1
index 6054773..0709dbe 100644
@@ -585,7 +585,7 @@ HsmModifyExtentMap(
 	struct getbmapx	*bmap)
 {
 	dmf_f_ctxt_t	*dmf_f_ctxtp = (dmf_f_ctxt_t *)contextp;
-	__int64_t	length;
+	int64_t		length;
 
 	if (bmap[0].bmv_entries <= 0) {
 		return 1;	/* caller must already be at EOF */
doc/xfsdump.html +4 -4
index 9c6722e..8cc02d4 100644
@@ -1935,7 +1935,7 @@ The files are constructed like so:
 <pre>
 typedef struct invt_counter {
     INVT_COUNTER_FIELDS
-        __uint32_t    ic_vernum;/* on disk version number for posterity */\
+        uint32_t      ic_vernum;/* on disk version number for posterity */\
         u_int         ic_curnum;/* number of sessions/invindices recorded \
                                    so far */                              \
         u_int         ic_maxnum;/* maximum number of sessions/inv_indices \
@@ -1975,7 +1975,7 @@ typedef struct invt_fstab {
 <pre>
 typedef struct invt_counter {
     INVT_COUNTER_FIELDS
-        __uint32_t    ic_vernum;/* on disk version number for posterity */\
+        uint32_t      ic_vernum;/* on disk version number for posterity */\
         u_int         ic_curnum;/* number of sessions/invindices recorded \
                                    so far */                              \
         u_int         ic_maxnum;/* maximum number of sessions/inv_indices \
@@ -2012,7 +2012,7 @@ typedef struct invt_entry {
 <pre>
 typedef struct invt_sescounter {
     INVT_COUNTER_FIELDS
-        __uint32_t    ic_vernum;/* on disk version number for posterity */\
+        uint32_t      ic_vernum;/* on disk version number for posterity */\
         u_int         ic_curnum;/* number of sessions/invindices recorded \
                                    so far */                              \
         u_int         ic_maxnum;/* maximum number of sessions/inv_indices \
@@ -2034,7 +2034,7 @@ typedef struct invt_seshdr {
     off64_t    sh_streams_off; /* offset to start of the set of
                                   stream hdrs */
     time_t     sh_time;        /* time of the dump */
-    __uint32_t sh_flag;        /* for misc flags */
+    uint32_t   sh_flag;        /* for misc flags */
     u_char     sh_level;       /* dump level */
     u_char     sh_pruned;      /* pruned by invutil flag */
     char       sh_padding[22];
inventory/inv_oref.h +1 -1
index e16684d..38303a4 100644
@@ -46,7 +46,7 @@
 
 
 
-typedef __uint32_t	invt_objtype_t;
+typedef uint32_t	invt_objtype_t;
 
 #define INVT_LOCKED		0x0001
 
inventory/inv_priv.h +2 -2
index aa94a33..5f2256d 100644
@@ -120,7 +120,7 @@ typedef struct invt_seshdr {
 	off64_t		sh_streams_off; /* offset to start of the set of 
 					   stream hdrs */
 	time32_t	sh_time;        /* time of the dump */
-	__uint32_t	sh_flag;        /* for misc flags */
+	uint32_t	sh_flag;        /* for misc flags */
 	u_char		sh_level;       /* dump level */
 	u_char		sh_pruned;      /* pruned by invutil flag */
 	char		sh_padding[22];
@@ -184,7 +184,7 @@ typedef struct invt_entry {
 
 /* Cheap Inheritance, and an attempt to avoid a nested type */
 #define INVT_COUNTER_FIELDS  \
-        __uint32_t    ic_vernum;/* on disk version number for posterity */\
+        uint32_t      ic_vernum;/* on disk version number for posterity */\
 	uint	      ic_curnum;/* number of sessions/invindices recorded \
 				   so far */				  \
 	uint	      ic_maxnum;/* maximum number of sessions/inv_indices \
inventory/inventory.h +1 -1
index 134b9ba..c1d7403 100644
@@ -43,7 +43,7 @@
 /* length of labels, mntpts, etc */
 #define INV_STRLEN              GLOBAL_HDR_STRING_SZ
 
-typedef __uint32_t		inv_version_t;
+typedef uint32_t		inv_version_t;
 
 /* This is the general inventory version. 
  */
Signature · 1 line
2.14.1
author
#2 lore raw

PATCH 3/5 replace use of SIGCLD with SIGCHLD

In reply to Khem Raj
---
 common/main.c    | 2 +-
 doc/xfsdump.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
common/main.c +1 -1
index b34e974..49dd361 100644
@@ -2237,7 +2237,7 @@ static sig_printmap_t sig_printmap[ ] = {
 	{SIGTERM,	"SIGTERM"},
 	{SIGUSR1,	"SIGUSR1"},
 	{SIGUSR2,	"SIGUSR2"},
-	{SIGCLD,	"SIGCLD"},
+	{SIGCHLD,	"SIGCHLD"},
 	{SIGPWR,	"SIGPWR"},
 	{SIGURG,	"SIGURG"},
 	{SIGPOLL,	"SIGPOLL"},
doc/xfsdump.html +1 -1
index 8cc02d4..9399bd6 100644
@@ -334,7 +334,7 @@ the ring buffer. It ignores signals and does not terminate until it
 receives a RING_OP_DIE message. It then exits 0.
 <p>
 The main process sleeps waiting for any of its children to die
-(ie. waiting for a SIGCLD). All children that it cares about (stream
+(ie. waiting for a SIGCHLD). All children that it cares about (stream
 managers and ring buffer slaves) are registered through the child
 manager abstraction. When a child dies wait status and other info is
 stored with its entry in the child manager. main() ignores the deaths
Signature · 1 line
2.14.1
author
#3 lore raw

PATCH 4/5 include limit.h for PATH_MAX

In reply to Khem Raj

fixed
var.c:42:12: error: 'PATH_MAX' undeclared (first use in this function); did you mean 'RAND_MAX'?
char path[PATH_MAX];`

---
 dump/var.c | 1 +
 1 file changed, 1 insertion(+)
dump/var.c +1 -0
index 645caab..8156d37 100644
@@ -16,6 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <limits.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/stat.h>
Signature · 1 line
2.14.1
author
#4 lore raw

PATCH 5/5 include sys/types.h for u_int32_t in attr/attributes.h

In reply to Khem Raj

error: unknown type name 'u_int32_t'

---
 restore/content.c | 1 +
 1 file changed, 1 insertion(+)
restore/content.c +1 -0
index 7c4a81f..1d5de1b 100644
@@ -24,6 +24,7 @@
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
+#include <sys/types.h>
 #include <attr/attributes.h>
 #include <xfs/handle.h>
 #include <time.h>
Signature · 1 line
2.14.1
#5 lore raw
In reply to Khem Raj

Hm, in looking over these, I see that Felix Janda already sent patches to fix all this back in Jan 2016; [PATCH 0/6] xfsdump: Compile with musl libc

That was around the time of a maintainer handoff, and it looks like they go lost. Since Felix did the original work, and those patches are already reviewed, I
think I'll pick them up to solve your issues. Thanks for the reminder though; unfortunately I /just/ released a new xfsdump version, but this is probably reason enough to do a fresh release so you (and Felix) can stop carrying patches.

In Felix's patches as well as in yours, the changelogs could be improved a bit to say /why/ the changes are being made, i.e. to support musl, which is more pedantic. I'll add that info on commit.

Thanks,
-Eric

Quoted 21 lines · Khem Raj

Fix
error: 'O_CREAT' undeclared (first use in this function)

---
 invutil/invidx.c | 1 +
 1 file changed, 1 insertion(+)
invutil/invidx.c +1 -0
index 67efdf7..325a9a1 100644
@@ -27,6 +27,7 @@
 #include <sys/stat.h>
 #include <string.h>
 #include <uuid/uuid.h>
+#include <fcntl.h>
 
 #include "types.h"
 #include "mlog.h"
author
#6 lore raw
Quoted 11 lines · Eric Sandeen

Hm, in looking over these, I see that Felix Janda already sent patches to fix all this back in Jan 2016; [PATCH 0/6] xfsdump: Compile with musl libc

That was around the time of a maintainer handoff, and it looks like they go lost. Since Felix did the original work, and those patches are already reviewed, I
think I'll pick them up to solve your issues. Thanks for the reminder though; unfortunately I /just/ released a new xfsdump version, but this is probably reason enough to do a fresh release so you (and Felix) can stop carrying patches.

Cool. Thanks

Quoted 5 lines

In Felix's patches as well as in yours, the changelogs could be improved a bit to say /why/ the changes are being made, i.e. to support musl, which is more pedantic. I'll add that info on commit.

OK. Thanks.

Quoted 26 lines

Thanks,
-Eric

Quoted 21 lines · Khem Raj

Fix
error: 'O_CREAT' undeclared (first use in this function)

---
 invutil/invidx.c | 1 +
 1 file changed, 1 insertion(+)
invutil/invidx.c +1 -0
index 67efdf7..325a9a1 100644
@@ -27,6 +27,7 @@
 #include <sys/stat.h>
 #include <string.h>
 #include <uuid/uuid.h>
+#include <fcntl.h>
 
 #include "types.h"
 #include "mlog.h"