diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-11-05 17:23:07 +0100 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-11-05 17:23:45 +0100 |
commit | 8d7cc54ec886e9cd27f4097ed1e68ea9bc5fe456 (patch) | |
tree | b83ab0ac17c964863ab2516a3924b5f2e1322804 | |
parent | 4f736bf72188699e39ed4e58bd4d9ebf22c068f3 (diff) | |
download | rtc-tools-8d7cc54ec886e9cd27f4097ed1e68ea9bc5fe456.tar.gz |
rtc: display string describing error number
Use strerror to display user friendly description of errno.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r-- | rtc.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -21,7 +21,8 @@ static char *rtc_file = "/dev/rtc0"; #define IOCTL(f, r, d, rc) rc = ioctl(f, r, d); \ if (rc) { \ - fprintf(stderr, "%s returned %d (line %d)\n", #r, errno, __LINE__); \ + fprintf(stderr, "%s returned %s (%d) at line %d\n", #r, \ + strerror(errno), errno, __LINE__); \ exit(errno); \ } |