svn commit: r324750 - stable/11/usr.sbin/i2c

Andriy Gapon avg at FreeBSD.org
Thu Oct 19 08:15:42 UTC 2017


Author: avg
Date: Thu Oct 19 08:15:41 2017
New Revision: 324750
URL: https://svnweb.freebsd.org/changeset/base/324750

Log:
  Really MFC r309357,r309409: Speling fixes and fix line endings for err_msg output
  
  Note: somehow these revisions were in mergeinfo but the actual changes
  were not merged.

Modified:
  stable/11/usr.sbin/i2c/i2c.c

Modified: stable/11/usr.sbin/i2c/i2c.c
==============================================================================
--- stable/11/usr.sbin/i2c/i2c.c	Thu Oct 19 08:00:34 2017	(r324749)
+++ stable/11/usr.sbin/i2c/i2c.c	Thu Oct 19 08:15:41 2017	(r324750)
@@ -350,7 +350,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c
 			error = ioctl(fd, I2CWRITE, &cmd);
 			free(buf);
 			if (error == -1) {
-				err_msg = "ioctl: error when write offset";
+				err_msg = "ioctl: error writing offset";
 				goto err1;
 			}
 		}
@@ -375,7 +375,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c
 		cmd.last = 0;
 		error = ioctl(fd, I2CWRITE, &cmd);
 		if (error == -1) {
-			err_msg = "ioctl: error when write";
+			err_msg = "ioctl: error writing";
 			goto err1;
 		}
 		break;
@@ -390,7 +390,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c
 			error = ioctl(fd, I2CWRITE, &cmd);
 			free(buf);
 			if (error == -1) {
-				err_msg = "ioctl: error when write offset";
+				err_msg = "ioctl: error writing offset";
 				goto err1;
 			}
 		}
@@ -411,7 +411,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c
 		cmd.last = 0;
 		error = ioctl(fd, I2CWRITE, &cmd);
 		if (error == -1) {
-			err_msg = "ioctl: error when write";
+			err_msg = "ioctl: error writing";
 			goto err1;
 		}
 		break;
@@ -434,7 +434,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c
 		error = ioctl(fd, I2CWRITE, &cmd);
 		free(buf);
 		if (error == -1) {
-			err_msg = "ioctl: error when write";
+			err_msg = "ioctl: error writing";
 			goto err1;
 		}
 		break;
@@ -453,10 +453,10 @@ err1:
 	cmd.slave = i2c_opt.addr;
 	error = ioctl(fd, I2CSTOP, &cmd);
 	if (error == -1)
-		fprintf(stderr, "error sending stop condtion\n");
+		fprintf(stderr, "error sending stop condition\n");
 err2:
 	if (err_msg)
-		fprintf(stderr, "%s", err_msg);
+		fprintf(stderr, "%s\n", err_msg);
 
 	close(fd);
 	return (1);
@@ -498,7 +498,7 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_
 		error = ioctl(fd, I2CWRITE, &cmd);
 		free(buf);
 		if (error == -1) {
-			err_msg = "ioctl: error when write offset";
+			err_msg = "ioctl: error writing offset";
 			goto err1;
 		}
 
@@ -506,7 +506,7 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_
 			cmd.slave = i2c_opt.addr;
 			error = ioctl(fd, I2CSTOP, &cmd);
 			if (error == -1) {
-				err_msg = "error sending stop condtion\n";
+				err_msg = "error sending stop condition";
 				goto err2;
 			}
 		}
@@ -531,7 +531,7 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_
 	}
 	error = ioctl(fd, I2CSTOP, &cmd);
 	if (error == -1) {
-		err_msg = "error sending stop condtion\n";
+		err_msg = "error sending stop condition";
 		goto err2;
 	}
 
@@ -550,10 +550,10 @@ err1:
 	cmd.slave = i2c_opt.addr;
 	error = ioctl(fd, I2CSTOP, &cmd);
 	if (error == -1)
-		fprintf(stderr, "error sending stop condtion\n");
+		fprintf(stderr, "error sending stop condition\n");
 err2:
 	if (err_msg)
-		fprintf(stderr, "%s", err_msg);
+		fprintf(stderr, "%s\n", err_msg);
 
 	close(fd);
 	return (1);


More information about the svn-src-stable mailing list