chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tree-wide: check if errno is greater then zero
[elogind.git]
/
src
/
basic
/
terminal-util.c
diff --git
a/src/basic/terminal-util.c
b/src/basic/terminal-util.c
index 9e7e3b618931bdce13f08c4558acaf95d4ec20ac..9fd4d3806ba0ceb223481f59ddfb3244dbbc9d82 100644
(file)
--- a/
src/basic/terminal-util.c
+++ b/
src/basic/terminal-util.c
@@
-121,7
+121,7
@@
int read_one_char(FILE *f, char *ret, usec_t t, bool *need_nl) {
errno = 0;
if (!fgets(line, sizeof(line), f))
errno = 0;
if (!fgets(line, sizeof(line), f))
- return errno ? -errno : -EIO;
+ return errno
> 0
? -errno : -EIO;
truncate_nl(line);
truncate_nl(line);
@@
-205,7
+205,7
@@
int ask_string(char **ret, const char *text, ...) {
errno = 0;
if (!fgets(line, sizeof(line), stdin))
errno = 0;
if (!fgets(line, sizeof(line), stdin))
- return errno ? -errno : -EIO;
+ return errno
> 0
? -errno : -EIO;
if (!endswith(line, "\n"))
putchar('\n');
if (!endswith(line, "\n"))
putchar('\n');