get_header_tar.c: makedev [PATCH]

Shaun Jackman sjackman at gmail.com
Wed Sep 28 22:14:59 UTC 2005


get_header_tar.c uses the macro makedev, which is not defined by any
standard header. In practice, it's defined either by sys/types.h,
sys/sysmacros.h, or sys/mkdev.h. glibc defines makedev in
sys/sysmacros.h which is included by sys/types.h. To support newlib,
include sys/sysmacros.h directly. I armoured the include in an ifdef
to allow for a system that defines makedev in sys/types.h but does not
provide sys/sysmacros.h.

Cheers,
Shaun

2005-09-28  Shaun Jackman  <sjackman at gmail.com>

	* archival/libunarchive/get_header_tar.c: Include sys/sysmacros.h
	for makedev.

Index: archival/libunarchive/get_header_tar.c
===================================================================
--- archival/libunarchive/get_header_tar.c	(revision 11683)
+++ archival/libunarchive/get_header_tar.c	(working copy)
@@ -26,6 +26,10 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/types.h>
+#ifndef makedev
+# include <sys/sysmacros.h>
+#endif
 #include "unarchive.h"
 #include "libbb.h"



More information about the busybox mailing list