Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Sep 2013 12:32:05 +0000 (UTC)
From:      Dmitry Marakasov <amdmi3@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r327472 - head/sysutils/gpart/files
Message-ID:  <201309171232.r8HCW54w019003@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: amdmi3
Date: Tue Sep 17 12:32:05 2013
New Revision: 327472
URL: http://svnweb.freebsd.org/changeset/ports/327472

Log:
  - Fix build with clang/libc++
  - Rename patches with accordance to porter's handbook

Added:
  head/sysutils/gpart/files/patch-man-gpart.man
     - copied unchanged from r327267, head/sysutils/gpart/files/patch-man__gpart.man
  head/sysutils/gpart/files/patch-src-disku.c
     - copied unchanged from r327267, head/sysutils/gpart/files/patch-src__disku.c
  head/sysutils/gpart/files/patch-src-gm__bsddl.h
     - copied unchanged from r327267, head/sysutils/gpart/files/patch-src__gm_bsddl.h
  head/sysutils/gpart/files/patch-src-gm__ntfs.h
     - copied unchanged from r327267, head/sysutils/gpart/files/patch-src__gm_ntfs.h
  head/sysutils/gpart/files/patch-src-gpart.c   (contents, props changed)
  head/sysutils/gpart/files/patch-src-gpart.h
     - copied unchanged from r327267, head/sysutils/gpart/files/patch-src__gpart.h
Deleted:
  head/sysutils/gpart/files/patch-man__gpart.man
  head/sysutils/gpart/files/patch-src__disku.c
  head/sysutils/gpart/files/patch-src__gm_bsddl.h
  head/sysutils/gpart/files/patch-src__gm_ntfs.h
  head/sysutils/gpart/files/patch-src__gpart.h

Copied: head/sysutils/gpart/files/patch-man-gpart.man (from r327267, head/sysutils/gpart/files/patch-man__gpart.man)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/gpart/files/patch-man-gpart.man	Tue Sep 17 12:32:05 2013	(r327472, copy of r327267, head/sysutils/gpart/files/patch-man__gpart.man)
@@ -0,0 +1,11 @@
+--- ./man/gpart.man.orig	2001-02-07 18:54:18.000000000 +0100
++++ ./man/gpart.man	2011-03-17 01:15:54.000000000 +0100
+@@ -378,7 +378,7 @@
+ drive without starting the scan loop in FreeBSD type
+ 
+ .RS
+-gpart -vvd /dev/wd2
++gpart -vvd /dev/ad2
+ .RE
+ .RE
+ 

Copied: head/sysutils/gpart/files/patch-src-disku.c (from r327267, head/sysutils/gpart/files/patch-src__disku.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/gpart/files/patch-src-disku.c	Tue Sep 17 12:32:05 2013	(r327472, copy of r327267, head/sysutils/gpart/files/patch-src__disku.c)
@@ -0,0 +1,45 @@
+--- ./src/disku.c.orig	2001-02-07 20:04:07.000000000 +0100
++++ ./src/disku.c	2011-03-17 01:15:54.000000000 +0100
+@@ -28,7 +28,9 @@
+ 
+ #if defined(__FreeBSD__)
+ #include <errno.h>
++#include <sys/param.h>
+ #include <sys/disklabel.h>
++#include <sys/disk.h>
+ #endif
+ 
+ 
+@@ -61,12 +63,26 @@
+ #endif
+ 
+ #if defined(__FreeBSD__)
+-	struct disklabel	dl;
+-	if (ioctl(d->d_fd,DIOCGDINFO,&dl) == -1)
+-		pr(FATAL,EM_IOCTLFAILED,"DIOCGDINFO",strerror(errno));
+-	g.d_c = dl.d_ncylinders;
+-	g.d_h = dl.d_ntracks;
+-	g.d_s = dl.d_nsectors;
++	struct disklabel	loclab;
++	u_int    u;
++	off_t	 o; /* total disk size */
++
++	if (ioctl(d->d_fd, DIOCGFWSECTORS, &u) == 0)
++		g.d_s = u;
++	else
++		pr(FATAL, EM_IOCTLFAILED, "DIOCGFWSECTORS", strerror(errno));
++		// loclab.d_nsectors = 63;
++	if (ioctl(d->d_fd, DIOCGFWHEADS, &u) == 0)
++		g.d_h = u;
++	else
++		pr(FATAL, EM_IOCTLFAILED, "DIOCGFWHEADS", strerror(errno));
++	if (ioctl(d->d_fd, DIOCGSECTORSIZE, &u) == 0)
++		if (u != 512)
++		    pr(FATAL, "sector size not a multiple of 512");
++	if (ioctl(d->d_fd, DIOCGMEDIASIZE, &o))
++		pr(FATAL, EM_IOCTLFAILED, "DIOCGMEDIASIZE", strerror(errno));
++
++	g.d_c = o / u / g.d_h / g.d_s;
+ #endif
+ 
+ 	return (&g);

Copied: head/sysutils/gpart/files/patch-src-gm__bsddl.h (from r327267, head/sysutils/gpart/files/patch-src__gm_bsddl.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/gpart/files/patch-src-gm__bsddl.h	Tue Sep 17 12:32:05 2013	(r327472, copy of r327267, head/sysutils/gpart/files/patch-src__gm_bsddl.h)
@@ -0,0 +1,11 @@
+--- ./src/gm_bsddl.h.orig	2000-12-13 23:54:31.000000000 +0100
++++ ./src/gm_bsddl.h	2011-03-17 01:15:54.000000000 +0100
+@@ -28,7 +28,7 @@
+ 
+ #define BBSIZE		8192	/* size of boot area, with label */
+ 
+-#ifdef __i386__
++#if defined(__i386__) || defined(__amd64__)
+ #define LABELSECTOR	1			/* sector containing label */
+ #define LABELOFFSET	0			/* offset of label in sector */
+ #endif

Copied: head/sysutils/gpart/files/patch-src-gm__ntfs.h (from r327267, head/sysutils/gpart/files/patch-src__gm_ntfs.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/gpart/files/patch-src-gm__ntfs.h	Tue Sep 17 12:32:05 2013	(r327472, copy of r327267, head/sysutils/gpart/files/patch-src__gm_ntfs.h)
@@ -0,0 +1,34 @@
+--- ./src/gm_ntfs.h.orig	2001-01-29 21:33:58.000000000 +0100
++++ ./src/gm_ntfs.h	2011-03-17 01:15:54.000000000 +0100
+@@ -29,17 +29,16 @@
+ /* 'NTFS' in little endian */
+ #define NTFS_SUPER_MAGIC	0x5346544E
+ 
+-#if defined(i386) || defined(__i386__) || defined(__alpha__)
++#include <stdint.h>
+ 
+ /* unsigned integral types */
+ #ifndef NTFS_INTEGRAL_TYPES
+ #define NTFS_INTEGRAL_TYPES
+-typedef unsigned char		ntfs_u8;
+-typedef unsigned short		ntfs_u16;
+-typedef unsigned int		ntfs_u32;
+-typedef s64_t			ntfs_u64;
++typedef uint8_t		ntfs_u8;
++typedef uint16_t	ntfs_u16;
++typedef uint32_t	ntfs_u32;
++typedef uint64_t	ntfs_u64;
+ #endif /* NTFS_INTEGRAL_TYPES */
+-#endif /* defined(i386) || defined(__i386__) || defined(__alpha__) */
+ 
+ 
+ /* Macros reading unsigned integers from a byte pointer */
+@@ -53,8 +52,5 @@
+ /* Macros reading signed integers, returning int */
+ #define NTFS_GETS8(p)		((int)(*(char*)(p)))
+ #define NTFS_GETS16(p)		((int)(*(short*)(p)))
+-#define NTFS_GETS24(p)		(NTFS_GETU24(p) < 0x800000 ? (int)NTFS_GETU24(p) :
+-
+-
+ 
+ #endif /* _GM_NTFS_H */

Added: head/sysutils/gpart/files/patch-src-gpart.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/gpart/files/patch-src-gpart.c	Tue Sep 17 12:32:05 2013	(r327472)
@@ -0,0 +1,65 @@
+--- src/gpart.c.orig	2001-02-07 21:08:08.000000000 +0300
++++ src/gpart.c	2013-09-17 03:12:11.505226148 +0400
+@@ -69,7 +69,7 @@
+ int		(*boundary_fun)(disk_desc *,s64_t);
+ unsigned long	increment = 'h', gc = 0, gh = 0, gs = 0;
+ s64_t		skipsec = 0, maxsec = 0;
+-FILE		*log = 0;
++FILE		*logfile = 0;
+ 
+ 
+ 
+@@ -125,26 +125,26 @@
+ 		case FATAL :
+ 			g_mod_deleteall();
+ 			if (! f_quiet) fprintf(stderr,EM_FATALERROR,msg);
+-			if (log)
++			if (logfile)
+ 			{
+-				fprintf(log,EM_FATALERROR,msg);
+-				fclose(log);
++				fprintf(logfile,EM_FATALERROR,msg);
++				fclose(logfile);
+ 			}
+ 			exit(1);
+ 		case ERROR :
+ 			if (! f_quiet) fprintf(stderr,EM_SIMPLEERROR,msg);
+-			if (log) fprintf(log,EM_SIMPLEERROR,msg);
++			if (logfile) fprintf(logfile,EM_SIMPLEERROR,msg);
+ 			break;
+ 		case WARN :
+ 			if (! f_quiet) fprintf(stderr,EM_WARNING,msg);
+-			if (log) fprintf(log,EM_WARNING,msg);
++			if (logfile) fprintf(logfile,EM_WARNING,msg);
+ 			break;
+ 		case MSG :
+ 			if (! f_quiet) fputs(msg,stdout); fflush(stdout);
+-			if (log) fputs(msg,log);
++			if (logfile) fputs(msg,logfile);
+ 			break;
+ 	}
+-	if (log) fflush(log);
++	if (logfile) fflush(logfile);
+ }
+ 
+ 
+@@ -1750,8 +1750,8 @@
+ 				}
+ 				break;
+ 			case 'l' :
+-				if (log) fclose(log);
+-				if ((log = fopen(optarg,"w")) == 0)
++				if (logfile) fclose(logfile);
++				if ((logfile = fopen(optarg,"w")) == 0)
+ 					pr(FATAL,EM_OPENLOG,optarg);
+ 				break;
+ 			case 'L' :
+@@ -1831,7 +1831,7 @@
+ 		}
+ 	}
+ 	free_disk_desc(d);
+-	if (log) fclose(log);
++	if (logfile) fclose(logfile);
+ 
+ 	return (f_check ? no_of_incons : 0);
+ }

Copied: head/sysutils/gpart/files/patch-src-gpart.h (from r327267, head/sysutils/gpart/files/patch-src__gpart.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/gpart/files/patch-src-gpart.h	Tue Sep 17 12:32:05 2013	(r327472, copy of r327267, head/sysutils/gpart/files/patch-src__gpart.h)
@@ -0,0 +1,42 @@
+--- ./src/gpart.h.orig	2001-01-31 00:07:29.000000000 +0100
++++ ./src/gpart.h	2011-03-17 01:15:54.000000000 +0100
+@@ -22,8 +22,9 @@
+ 
+ #define PROGRAM		"gpart"
+ 
++#include <stdint.h>
+ 
+-typedef unsigned char byte_t;
++typedef uint8_t byte_t;
+ 
+ 
+ 
+@@ -31,7 +32,7 @@
+  * endianness (incomplete, later)
+  */
+ 
+-#if defined(__i386__) || defined(__alpha__)
++#if defined(__i386__) || defined(__amd64__) || defined(__alpha__)
+ #	define le16(x)	(x)		/* x as little endian */
+ #	define be16(x)	((((x)&0xff00)>>8)			| \
+ 			(((x)&0x00ff)<<8))
+@@ -112,8 +113,8 @@
+ 	byte_t		p_ehd;		/* end head */
+ 	byte_t		p_esect;	/* end sector */
+ 	byte_t		p_ecyl;		/* end cylinder */
+-	unsigned long	p_start;	/* start sector (absolute) */
+-	unsigned long	p_size;		/* # of sectors */
++	uint32_t	p_start;	/* start sector (absolute) */
++	uint32_t	p_size;		/* # of sectors */
+ } dos_part_entry;
+ 
+ 
+@@ -123,7 +124,7 @@
+ 	byte_t		_align[2];
+ 	byte_t		t_boot[DOSPARTOFF];
+ 	dos_part_entry	t_parts[NDOSPARTS];
+-	unsigned short	t_magic;	/* DOSPTMAGIC */
++	uint16_t	t_magic;	/* DOSPTMAGIC */
+ } dos_part_table;
+ 
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309171232.r8HCW54w019003>