Skip to content

Commit ba7a877

Browse files
authored
Merge pull request opencontainers#3168 from kolyshkin/fix-cc-warn
libct/nsenter: fix unused-result warning
2 parents e53e97a + db8330c commit ba7a877

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libcontainer/nsenter/nsexec.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ static void write_log(const char *level, const char *format, ...)
168168
goto out;
169169
}
170170

171-
write(logfd, json, ret);
171+
/* This logging is on a best-effort basis. In case of a short or failed
172+
* write there is nothing we can do, so just ignore write() errors.
173+
*/
174+
ssize_t __attribute__((unused)) __res = write(logfd, json, ret);
172175

173176
out:
174177
free(message);

0 commit comments

Comments
 (0)