Submitted by someone who thinks he's called "Daper":

Fix bug #15013: Wrong use of PPICLAIM (kernel: ppdev0: claim the
port first)

* par.c: don't claim/release here (thus win_ppdev.h not needed
anymore)
* ppi.c: claim/release here.
* freebsd_ppi.h: ppi_claim/ppi_release now take an fd as parameter.
* solaris_ecpp.h: (Ditto.)
* linux_ppdev.h: (Ditto.)  (Also add copyright.)
* win_ppdev.h: Not needed anymore, remove.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@557 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch
2005-11-29 20:20:22 +00:00
parent f68ed0ca7a
commit dbe35b16f8
7 changed files with 52 additions and 28 deletions

View File

@@ -1,5 +1,26 @@
#ifndef __linux_ppdev_h__
#define __linux_ppdev_h__
/*
* avrdude - A Downloader/Uploader for AVR device programmers
* Copyright (C) 2003, 2005 Theodore A. Roth
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Id$ */
#ifndef linux_ppdev_h
#define linux_ppdev_h
#define OBSOLETE__IOW _IOW
@@ -9,16 +30,16 @@
#include <stdlib.h>
#define ppi_claim(pgm) \
if (ioctl(pgm->fd, PPCLAIM)) { \
#define ppi_claim(fd) \
if (ioctl(fd, PPCLAIM)) { \
fprintf(stderr, "%s: can't claim device \"%s\": %s\n\n", \
progname, port, strerror(errno)); \
close(pgm->fd); \
close(fd); \
exit(1); \
}
}
#define ppi_release(pgm) \
if (ioctl(pgm->fd, PPRELEASE)) { \
#define ppi_release(fd) \
if (ioctl(fd, PPRELEASE)) { \
fprintf(stderr, "%s: can't release device: %s\n\n", \
progname, strerror(errno)); \
exit(1); \
@@ -33,4 +54,4 @@
(reg) == PPIDATA? PPWDATA: ((reg) == PPICTRL? PPWCONTROL: PPWSTATUS), \
valp)
#endif /* __linux_ppdev_h__ */
#endif /* linux_ppdev_h */