Speling fixes and fix line endings for err_msg output.
In some cases there was not \n, in other cases there was.
This commit is contained in:
parent
03bc1fa2f9
commit
16e7325493
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=309357
@ -310,7 +310,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf)
|
|||||||
error = ioctl(fd, I2CWRITE, &cmd);
|
error = ioctl(fd, I2CWRITE, &cmd);
|
||||||
free(buf);
|
free(buf);
|
||||||
if (error == -1) {
|
if (error == -1) {
|
||||||
err_msg = "ioctl: error when write offset";
|
err_msg = "ioctl: error writing offset";
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -335,7 +335,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf)
|
|||||||
cmd.last = 0;
|
cmd.last = 0;
|
||||||
error = ioctl(fd, I2CWRITE, &cmd);
|
error = ioctl(fd, I2CWRITE, &cmd);
|
||||||
if (error == -1) {
|
if (error == -1) {
|
||||||
err_msg = "ioctl: error when write";
|
err_msg = "ioctl: error writing";
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -350,7 +350,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf)
|
|||||||
error = ioctl(fd, I2CWRITE, &cmd);
|
error = ioctl(fd, I2CWRITE, &cmd);
|
||||||
free(buf);
|
free(buf);
|
||||||
if (error == -1) {
|
if (error == -1) {
|
||||||
err_msg = "ioctl: error when write offset";
|
err_msg = "ioctl: error writing offset";
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -371,7 +371,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf)
|
|||||||
cmd.last = 0;
|
cmd.last = 0;
|
||||||
error = ioctl(fd, I2CWRITE, &cmd);
|
error = ioctl(fd, I2CWRITE, &cmd);
|
||||||
if (error == -1) {
|
if (error == -1) {
|
||||||
err_msg = "ioctl: error when write";
|
err_msg = "ioctl: error writing";
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -394,7 +394,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf)
|
|||||||
error = ioctl(fd, I2CWRITE, &cmd);
|
error = ioctl(fd, I2CWRITE, &cmd);
|
||||||
free(buf);
|
free(buf);
|
||||||
if (error == -1) {
|
if (error == -1) {
|
||||||
err_msg = "ioctl: error when write";
|
err_msg = "ioctl: error writing";
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -416,7 +416,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf)
|
|||||||
fprintf(stderr, "error sending stop condtion\n");
|
fprintf(stderr, "error sending stop condtion\n");
|
||||||
err2:
|
err2:
|
||||||
if (err_msg)
|
if (err_msg)
|
||||||
fprintf(stderr, "%s", err_msg);
|
fprintf(stderr, "%s\n", err_msg);
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
return (1);
|
return (1);
|
||||||
@ -458,7 +458,7 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_buf)
|
|||||||
error = ioctl(fd, I2CWRITE, &cmd);
|
error = ioctl(fd, I2CWRITE, &cmd);
|
||||||
free(buf);
|
free(buf);
|
||||||
if (error == -1) {
|
if (error == -1) {
|
||||||
err_msg = "ioctl: error when write offset";
|
err_msg = "ioctl: error writing offset";
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -466,7 +466,7 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_buf)
|
|||||||
cmd.slave = i2c_opt.addr;
|
cmd.slave = i2c_opt.addr;
|
||||||
error = ioctl(fd, I2CSTOP, &cmd);
|
error = ioctl(fd, I2CSTOP, &cmd);
|
||||||
if (error == -1) {
|
if (error == -1) {
|
||||||
err_msg = "error sending stop condtion\n";
|
err_msg = "error sending stop condtion";
|
||||||
goto err2;
|
goto err2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -491,7 +491,7 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_buf)
|
|||||||
}
|
}
|
||||||
error = ioctl(fd, I2CSTOP, &cmd);
|
error = ioctl(fd, I2CSTOP, &cmd);
|
||||||
if (error == -1) {
|
if (error == -1) {
|
||||||
err_msg = "error sending stop condtion\n";
|
err_msg = "error sending stop condtion";
|
||||||
goto err2;
|
goto err2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -513,7 +513,7 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_buf)
|
|||||||
fprintf(stderr, "error sending stop condtion\n");
|
fprintf(stderr, "error sending stop condtion\n");
|
||||||
err2:
|
err2:
|
||||||
if (err_msg)
|
if (err_msg)
|
||||||
fprintf(stderr, "%s", err_msg);
|
fprintf(stderr, "%s\n", err_msg);
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
return (1);
|
return (1);
|
||||||
|
Loading…
Reference in New Issue
Block a user