Skip to content

Commit

Permalink
pkg/unshare: declare init() as static
Browse files Browse the repository at this point in the history
This commit declare C init() function as static,
since this is a constructor there is no need to
export this symbol, avoiding errors like
'multiple definitions error' when linking the binary.

Fixes: #1304
Signed-off-by: Luis Gustavo S. Barreto <gustavo@ossystems.com.br>
  • Loading branch information
gustavosbarreto committed Aug 5, 2022
1 parent 7db8254 commit 89878da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/unshare/unshare_cgo.go
Expand Up @@ -5,7 +5,7 @@ package unshare

// #cgo CFLAGS: -Wall
// extern void _containers_unshare(void);
// void __attribute__((constructor)) init(void) {
// static void __attribute__((constructor)) init(void) {
// _containers_unshare();
// }
import "C"
2 changes: 1 addition & 1 deletion pkg/unshare/unshare_gccgo.go
Expand Up @@ -4,7 +4,7 @@ package unshare

// #cgo CFLAGS: -Wall -Wextra
// extern void _containers_unshare(void);
// void __attribute__((constructor)) init(void) {
// static void __attribute__((constructor)) init(void) {
// _containers_unshare();
// }
import "C"
Expand Down

0 comments on commit 89878da

Please sign in to comment.