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

[1.0] libct/nsenter: fix unused-result warning #3169

Merged
merged 1 commit into from Aug 18, 2021

Conversation

kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Aug 17, 2021

Backport of #3168 to release-1.0. Draft until that one is merged.

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
(cherry picked from commit db8330c)
Signed-off-by: Kir Kolyshkin kolyshkin@gmail.com

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>
(cherry picked from commit db8330c)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin kolyshkin marked this pull request as draft August 17, 2021 22:44
@kolyshkin kolyshkin mentioned this pull request Aug 17, 2021
@kolyshkin kolyshkin added this to the 1.0.2 milestone Aug 17, 2021
@AkihiroSuda AkihiroSuda marked this pull request as ready for review August 18, 2021 02:39
@mrunalp mrunalp merged commit 9c4d5c6 into opencontainers:release-1.0 Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants