]> www.infradead.org Git - mtd-utils.git/commitdiff
tests: checkfs: fix linker warnings
authorAndy Shevchenko <ext-andriy.shevchenko@nokia.com>
Tue, 5 Apr 2011 13:55:51 +0000 (16:55 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 5 Apr 2011 14:20:53 +0000 (17:20 +0300)
The sys_errlist[errno] is deprecated. We should use strerror(errno) instead.

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
tests/checkfs/checkfs.c

index 6ca2c0ee3a9497e8db5186da1a4127736fdc8804..3224d2b996b34fdde695995d3025362e81009edb 100644 (file)
@@ -167,11 +167,11 @@ int setupSerial (const char *dev) {
 
     fd = open(dev,O_RDWR | O_NDELAY );
     if (fd < 0) {
-        fprintf(stderr, "%s: %s\n", dev, sys_errlist[errno]);
+        fprintf(stderr, "%s: %s\n", dev, strerror(errno));
         exit(1);
     }
     if (tcgetattr(fd, &tios) < 0) {
-        fprintf(stderr,"Could not get terminal attributes: %s",sys_errlist[errno]);
+        fprintf(stderr, "Could not get terminal attributes: %s", strerror(errno));
         exit(1);
     }
 
@@ -197,7 +197,7 @@ int setupSerial (const char *dev) {
     cfsetispeed (&tios, B9600);
 
     if (tcsetattr(fd, TCSAFLUSH, &tios) < 0) {
-        fprintf(stderr,"Could not set attributes: ,%s",sys_errlist[errno]);
+        fprintf(stderr, "Could not set attributes: ,%s", strerror(errno));
         exit(1);
     }
     return fd;