Patchwork [PATCHv1,2/5] tests: checkfs: fix linker warnings

login
register
mail settings
Submitter Shevchenko Andriy (EXT-Teleca/Helsinki)
Date April 5, 2011, 1:55 p.m.
Message ID <112dd0ed24fca0a1af988a2c99f1258468184d68.1302011698.git.ext-andriy.shevchenko@nokia.com>
Download mbox | patch
Permalink /patch/89864/
State New
Headers show

Comments

Shevchenko Andriy (EXT-Teleca/Helsinki) - April 5, 2011, 1:55 p.m.
The sys_errlist[errno] is deprecated. We should use strerror(errno) instead.

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
---
 tests/checkfs/checkfs.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Artem Bityutskiy - April 5, 2011, 2:15 p.m.
On Tue, 2011-04-05 at 16:55 +0300, Andy Shevchenko wrote:
> The sys_errlist[errno] is deprecated. We should use strerror(errno) instead.
> 
> Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
> ---
>  tests/checkfs/checkfs.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

Pushed this one, thanks!

Patch

diff --git a/tests/checkfs/checkfs.c b/tests/checkfs/checkfs.c
index 6ca2c0e..3224d2b 100644
--- a/tests/checkfs/checkfs.c
+++ b/tests/checkfs/checkfs.c
@@ -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;