mirror of
https://github.com/troglobit/finit.git
synced 2026-10-21 11:29:42 +00:00
Refactor, wrap write() syscall in new dprint() function
Fixes the GCC warning for unchecked return value from write(): ... ignoring return value of ‘write’, declared with attribute warn_unused_result The new dprint() function wraps write() in a bounded retry-loop that catches EINTR. The length argument is optional computed with strlen() if omitted (zero). Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
c84c17ea8c
commit
5342881bf4
5 files changed
+41
-24
No files matched your search
+1
-1
@@ -170,7 +170,7 @@ ssize_t cprintf(const char *fmt, ...)
|
||||
va_end(ap);
|
||||
|
||||
for (i = 0; i < num_cons; i++)
|
||||
(void)write(fds[i], buf, size);
|
||||
dprint(fds[i], buf, size);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user