From avgapon@voliacable.com  Sun Nov 27 20:39:20 2011
Return-Path: <avgapon@voliacable.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E84F9106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 27 Nov 2011 20:39:20 +0000 (UTC)
	(envelope-from avgapon@voliacable.com)
Received: from forward12.mail.yandex.net (forward12.mail.yandex.net [IPv6:2a02:6b8:0:801::2])
	by mx1.freebsd.org (Postfix) with ESMTP id 6DDDD8FC14
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 27 Nov 2011 20:39:20 +0000 (UTC)
Received: from smtp13.mail.yandex.net (smtp13.mail.yandex.net [95.108.130.68])
	by forward12.mail.yandex.net (Yandex) with ESMTP id AC62AC215F1
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 Nov 2011 00:39:18 +0400 (MSK)
Received: from smtp13.mail.yandex.net (localhost [127.0.0.1])
	by smtp13.mail.yandex.net (Yandex) with ESMTP id 9DE15E40018
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 Nov 2011 00:39:18 +0400 (MSK)
Received: from brash.arbitrater.volia.net (brash.arbitrater.volia.net [93.74.71.47])
	by smtp13.mail.yandex.net (nwsmtp/Yandex) with ESMTP id dHrasjL0-dIrOicYi;
	Mon, 28 Nov 2011 00:39:18 +0400
Received: from trant.local. (localhost [127.0.0.1])
	by trant.local. (8.14.5/8.14.5) with ESMTP id pARKdGBT030950
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 27 Nov 2011 22:39:16 +0200 (EET)
	(envelope-from root@trant.local)
Received: (from root@localhost)
	by trant.local. (8.14.5/8.14.5/Submit) id pARKdGZj030949;
	Sun, 27 Nov 2011 22:39:16 +0200 (EET)
	(envelope-from root)
Message-Id: <201111272039.pARKdGZj030949@trant.local.>
Date: Sun, 27 Nov 2011 22:39:16 +0200 (EET)
From: Andriy Gapon <avg@icyb.net.ua>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [MAINTAINER] sysutils/udfclient: fix build on newer FreeBSD
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         162909
>Category:       ports
>Synopsis:       [MAINTAINER] sysutils/udfclient: fix build on newer FreeBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    crees
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 27 20:40:09 UTC 2011
>Closed-Date:    Sun Nov 27 21:16:16 UTC 2011
>Last-Modified:  Sun Nov 27 21:20:07 UTC 2011
>Originator:     Andriy Gapon
>Release:        FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
System: FreeBSD 10.0-CURRENT amd64
>Description:
[DESCRIBE CHANGES]

Added file(s):
- files/patch-uscsi_subr.c

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- udfclient-0.7.5.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/sysutils/udfclient.orig/files/patch-uscsi_subr.c /usr/ports/sysutils/udfclient/files/patch-uscsi_subr.c
--- /usr/ports/sysutils/udfclient.orig/files/patch-uscsi_subr.c	1970-01-01 03:00:00.000000000 +0300
+++ /usr/ports/sysutils/udfclient/files/patch-uscsi_subr.c	2011-11-27 16:41:30.634782970 +0200
@@ -0,0 +1,45 @@
+--- uscsi_subr.c.orig	2011-11-15 19:51:44.387439246 +0200
++++ uscsi_subr.c	2011-11-27 16:41:07.706327140 +0200
+@@ -412,6 +412,7 @@ uscsi_command(int flags, struct uscsi_de
+ 	struct scsi_sense_data *cam_sense_data;
+ 	union ccb ccb;
+ 	uint32_t cam_sense;
++	u_int sense_len;
+ 	uint8_t *keypos;
+ 	int camflags;
+ 
+@@ -468,17 +469,33 @@ uscsi_command(int flags, struct uscsi_de
+ 
+ 	/* print sense info */
+ 	cam_sense_data = &ccb.csio.sense_data;
++	sense_len = ccb.csio.sense_len - ccb.csio.sense_resid;
+ 	if (uscsi_sense) {
++#if __FreeBSD_version > 900043
++		int error_code, sense_key;
++		uint8_t sks[3];
++
++		scsi_extract_sense_len(cam_sense_data, sense_len,
++		    &error_code, &sense_key,
++		    &uscsi_sense->asc, &uscsi_sense->ascq, /*show_errors*/ 0);
++
++		if ((scsi_get_sks(cam_sense_data, sense_len, sks) == 0)) {
++			uscsi_sense->skey_valid = 1;
++			uscsi_sense->sense_key  = (sks[1] << 8) | sks[2];
++		} else
++			uscsi_sense->skey_valid = 0;
++#else
+ 		uscsi_sense->asc  = cam_sense_data->add_sense_code;
+ 		uscsi_sense->ascq = cam_sense_data->add_sense_code_qual;
+ 		keypos  = cam_sense_data->sense_key_spec;
+ 		uscsi_sense->skey_valid =  keypos[0] & 128;
+ 		uscsi_sense->sense_key  = (keypos[1] << 8) | (keypos[2]);
++#endif
+ 	}
+ 
+ 	uscsi_print_sense((char *) disc->dev_name,
+ 		cmd, cmdlen,
+-		(uint8_t *) cam_sense_data, 8 + cam_sense_data->extra_len, 1);
++		(uint8_t *) cam_sense_data, sense_len, 1);
+ 
+ 	return EFAULT;
+ }
--- udfclient-0.7.5.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->crees 
Responsible-Changed-By: crees 
Responsible-Changed-When: Sun Nov 27 20:46:02 UTC 2011 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=162909 
State-Changed-From-To: open->closed 
State-Changed-By: crees 
State-Changed-When: Sun Nov 27 21:16:15 UTC 2011 
State-Changed-Why:  
Committed, with minor changes. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=162909 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/162909: commit references a PR
Date: Sun, 27 Nov 2011 21:16:19 +0000 (UTC)

 crees       2011-11-27 21:16:05 UTC
 
   FreeBSD ports repository
 
   Modified files:
     sysutils/udfclient   Makefile 
   Added files:
     sysutils/udfclient/files patch-uscsi_subr.c 
   Log:
   - Fix build on 9+
   - Use bsd.port.options.mk
   
   PR:             ports/162909
   Submitted by:   avg (maintainer)
   Feature safe:   yes
   
   Revision  Changes    Path
   1.21      +3 -6      ports/sysutils/udfclient/Makefile
   1.1       +45 -0     ports/sysutils/udfclient/files/patch-uscsi_subr.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
