mirror of
https://github.com/systemd/systemd.git
synced 2024-11-07 01:27:11 +03:00
Merge pull request #7755 from floppym/fileio-error
fileio: write_string_stream_ts: return errors from fputs and fputc
This commit is contained in:
commit
b954c051c2
@ -65,9 +65,15 @@ int write_string_stream_ts(
|
||||
assert(f);
|
||||
assert(line);
|
||||
|
||||
fputs(line, f);
|
||||
if (ferror(f))
|
||||
return -EIO;
|
||||
|
||||
if (fputs(line, f) == EOF)
|
||||
return -errno;
|
||||
|
||||
if (!(flags & WRITE_STRING_FILE_AVOID_NEWLINE) && !endswith(line, "\n"))
|
||||
fputc('\n', f);
|
||||
if (fputc('\n', f) == EOF)
|
||||
return -errno;
|
||||
|
||||
if (ts) {
|
||||
struct timespec twice[2] = {*ts, *ts};
|
||||
|
Loading…
Reference in New Issue
Block a user