Re: svn commit: r199079 - head/sbin/camcontrol

[ Available lists | Index of svn-src-all | Month of Nov 2009 | Week of 10 Nov 2009 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
M. Warner Losh <imp@bsdimp.com>
Date
10 Nov 2009 16:45:24
Subject
Re: svn commit: r199079 - head/sbin/camcontrol
Message-ID
20091110.093956.2069119515.imp@bsdimp.com


[ Hide this part ]
In message: <4AF85D75.1010605@freebsd.org>
Nathan Whitehorn <nwhitehorn@FreeBSD.org> writes:
: Alexander Motin wrote:
: > Author: mav
: > Date: Mon Nov 9 11:39:51 2009
: > New Revision: 199079
: > URL: http://svn.freebsd.org/changeset/base/199079
: >
: > Log:
: > Add support for ATA Power Management.
: >
: > Modified:
: > head/sbin/camcontrol/camcontrol.8
: > head/sbin/camcontrol/camcontrol.c
: >
: [...]
: > +static int
: > +atapm(struct cam_device *device, int argc, char **argv,
: > + char *combinedopt, int retry_count, int timeout)
: > +{
: > + union ccb *ccb;
: > + int retval = 0;
: > + int t = -1;
: > + char c;
: >
: >
: [...]
: > +
: > + while ((c = getopt(argc, argv, combinedopt)) != -1) {
: > + switch (c) {
: > + case 't':
: > + t = atoi(optarg);
: > + break;
: > + default:
: > + break;
: > + }
: > + }
: This broke world on PowerPC, where char is unsigned. Could you change
: the type of c to int, or explicitly mark it signed?

Since it is the result of getopt, it must be int. It can't be signed
char.

Warner

Elapsed time: 0.233 seconds