pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/brasero Fix CD burning handling on NetBSD. Fr...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/38faab8477bd
branches:  trunk
changeset: 556467:38faab8477bd
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sun Mar 22 09:30:38 2009 +0000

description:
Fix CD burning handling on NetBSD. From Jared McNeill in PR 41043.
Bump PKGREVISION.

diffstat:

 sysutils/brasero/Makefile            |   3 ++-
 sysutils/brasero/files/scsi-netbsd.c |  13 +++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)

diffs (65 lines):

diff -r 8d9af8b534c9 -r 38faab8477bd sysutils/brasero/Makefile
--- a/sysutils/brasero/Makefile Sun Mar 22 08:51:47 2009 +0000
+++ b/sysutils/brasero/Makefile Sun Mar 22 09:30:38 2009 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.2 2009/03/19 23:20:07 hasso Exp $
+# $NetBSD: Makefile,v 1.3 2009/03/22 09:30:38 wiz Exp $
 #
 
 DISTNAME=      brasero-2.26.0
+PKGREVISION=   1
 CATEGORIES=    sysutils gnome
 MASTER_SITES=  ${MASTER_SITE_GNOME:=sources/brasero/2.26/}
 EXTRACT_SUFX=  .tar.bz2
diff -r 8d9af8b534c9 -r 38faab8477bd sysutils/brasero/files/scsi-netbsd.c
--- a/sysutils/brasero/files/scsi-netbsd.c      Sun Mar 22 08:51:47 2009 +0000
+++ b/sysutils/brasero/files/scsi-netbsd.c      Sun Mar 22 09:30:38 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scsi-netbsd.c,v 1.1.1.1 2009/03/16 10:49:06 jmcneill Exp $ */
+/* $NetBSD: scsi-netbsd.c,v 1.2 2009/03/22 09:30:39 wiz Exp $ */
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Libbrasero-media
@@ -67,7 +67,8 @@
 #define BRASERO_SCSI_CMD_OPCODE_OFF                    0
 #define BRASERO_SCSI_CMD_SET_OPCODE(command)           (command->cmd [BRASERO_SCSI_CMD_OPCODE_OFF] = command->info->opcode)
 
-#define OPEN_FLAGS                     O_RDWR /*|O_EXCL */|O_NONBLOCK
+#define OPEN_FLAGS                     (O_RDWR|O_NONBLOCK)
+#define SCSIREQ_TIMEOUT                        (30 * 1000)
 
 /**
  * This is to send a command
@@ -85,6 +86,7 @@
        memcpy(req->cmd, cmd->cmd, req->cmdlen);
        req->databuf = buffer;
        req->datalen = size;
+       req->timeout = SCSIREQ_TIMEOUT;
 
        /* where to output the scsi sense buffer */
        req->senselen = BRASERO_SENSE_DATA_SIZE;
@@ -112,7 +114,7 @@
                                  size);
 
        res = ioctl (cmd->handle->fd, SCIOCCOMMAND, &req);
-       if (res) {
+       if (res == -1) {
                BRASERO_SCSI_SET_ERRCODE (error, BRASERO_SCSI_ERRNO);
                return BRASERO_SCSI_FAILURE;
        }
@@ -162,11 +164,14 @@
        int fd;
        int flags = OPEN_FLAGS;
        BraseroDeviceHandle *handle;
+       gchar *rdevnode;
 
        if (exclusive)
                flags |= O_EXCL;
 
-       fd = open (path, flags);
+       rdevnode = g_strdup_printf ("/dev/r%s", path + strlen ("/dev/"));
+       fd = open (rdevnode, flags);
+       g_free (rdevnode);
        if (fd < 0) {
                if (code) {
                        if (errno == EAGAIN



Home | Main Index | Thread Index | Old Index