Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libct/nsenter: fix unused-result warning #3168

Merged
merged 1 commit into from
Aug 18, 2021

Conversation

kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Aug 17, 2021

This is an alternative to #3165 / #3154.

Commit 2bab4a5 resulted in a warning from gcc:

nsexec.c: In function ‘write_log’:
nsexec.c:171:2: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
  171 |  write(logfd, json, ret);
      |  ^~~~~~~~~~~~~~~~~~~~~~~

As there's nothing we can or want to do in case write fails,
let's just tell the compiler we're not going to use it.

Fixes: 2bab4a5

1.0 backport: #3169

Commit 2bab4a5 resulted in a warning from gcc:

	nsexec.c: In function ‘write_log’:
	nsexec.c:171:2: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
	  171 |  write(logfd, json, ret);
	      |  ^~~~~~~~~~~~~~~~~~~~~~~

As there's nothing we can or want to do in case write fails,
let's just tell the compiler we're not going to use it.

Fixes: 2bab4a5
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@AkihiroSuda AkihiroSuda merged commit ba7a877 into opencontainers:master Aug 18, 2021
@kolyshkin kolyshkin added backport/done/1.0 A PR in main branch which was backported to release-1.0 and removed backport/todo/1.0 A PR in main branch which needs to be backported to release-1.0 labels Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/nsenter backport/done/1.0 A PR in main branch which was backported to release-1.0 easy-to-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants