Skip to content

Compilation error: ‘int openat2(int, const char*, const open_how*, size_t)’ was declared ‘extern’ and later ‘static’ #2453

@geneticdrift

Description

@geneticdrift

Bug report

Compilation error:
error: ‘int openat2(int, const char*, const open_how*, size_t)’ was declared ‘extern’ and later ‘static’

The test for openat2 at src/system/linux/openat2.h should be for HAVE_OPENAT2 instead of for HAVE_NATIVE_OPENAT2. HAVE_OPENAT2 cover both tests: system_linux_features.set('HAVE_OPENAT2', have_native_openat2 or compiler.has_header('linux/openat2.h')).

diff --git a/src/system/linux/openat2.h b/src/system/linux/openat2.h
index 807df97cb..ae26ef98b 100644
--- a/src/system/linux/openat2.h
+++ b/src/system/linux/openat2.h
@@ -8,7 +8,7 @@
 
 #include <fcntl.h>
 
-#ifndef HAVE_NATIVE_OPENAT2
+#ifndef HAVE_OPENAT2
 /* if the C library does not provide an openat2() wrappper, we roll
    our own */

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions