summaryrefslogtreecommitdiffstats
path: root/sbin/camcontrol
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2004-01-22 07:23:36 +0000
committergrehan <grehan@FreeBSD.org>2004-01-22 07:23:36 +0000
commit2dafdd4f00f15fa15ca85cd71c1f3c02f97f0e86 (patch)
tree376d48213587a799597a88ac216bca01388a3cb4 /sbin/camcontrol
parentf96af44358658859315aa3054e6738579d20d071 (diff)
downloadFreeBSD-src-2dafdd4f00f15fa15ca85cd71c1f3c02f97f0e86.zip
FreeBSD-src-2dafdd4f00f15fa15ca85cd71c1f3c02f97f0e86.tar.gz
Userland signed char fixes for PPC build. Problems were using a char
return for getopt() and comparing to -1, ditto with fgetc() and EOF, and using the kg_nice value from <sys/user.h> Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at> Reviewed by: obrien, bde (a while back) Tested lightly on: ppc, i386, make universe
Diffstat (limited to 'sbin/camcontrol')
-rw-r--r--sbin/camcontrol/modeedit.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sbin/camcontrol/modeedit.c b/sbin/camcontrol/modeedit.c
index 1702f19..3fb9587 100644
--- a/sbin/camcontrol/modeedit.c
+++ b/sbin/camcontrol/modeedit.c
@@ -362,6 +362,7 @@ load_format(const char *pagedb_path, int page)
int found;
int lineno;
enum { LOCATE, PAGENAME, PAGEDEF } state;
+ int ch;
char c;
#define SETSTATE_LOCATE do { \
@@ -397,19 +398,20 @@ load_format(const char *pagedb_path, int page)
lineno = 0;
found = 0;
SETSTATE_LOCATE;
- while ((c = fgetc(pagedb)) != EOF) {
+ while ((ch = fgetc(pagedb)) != EOF) {
/* Keep a line count to make error messages more useful. */
UPDATE_LINENO;
/* Skip over comments anywhere in the mode database. */
- if (c == '#') {
+ if (ch == '#') {
do {
- c = fgetc(pagedb);
- } while (c != '\n' && c != EOF);
+ ch = fgetc(pagedb);
+ } while (ch != '\n' && ch != EOF);
UPDATE_LINENO;
continue;
}
+ c = ch;
/* Strip out newline characters. */
if (c == '\n')
OpenPOWER on IntegriCloud