Skip to content

Commit

Permalink
move include of sys/mount back to where it was
Browse files Browse the repository at this point in the history
Turns out the sys/mount.h can be tricky to use
because various other system include files sometimes redefine
some of the symbols in this include file, leading
to compile failures.

Careful ordering of include files may solve the problem,
but here it simpler just to move the include of sys/mount.h
back to its original location.

related to #12181

Signed-off-by: Howard Pritchard <[email protected]>
(cherry picked from commit d2af1d7)
  • Loading branch information
hppritcha committed Jan 2, 2024
1 parent 5939b25 commit f2873b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions ompi/mca/fs/base/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
Expand Down
8 changes: 8 additions & 0 deletions ompi/mca/fs/base/fs_base_get_parent_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
#include "ompi/mca/fs/base/base.h"
#include "ompi/mca/common/ompio/common_ompio.h"

/*
* Be careful moving this include.
* It's easy to hit problems similar to that reported in
* https://github.com/systemd/systemd/issues/8507
*/
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif

void mca_fs_base_get_parent_dir ( char *filename, char **dirnamep)
{
Expand Down

0 comments on commit f2873b6

Please sign in to comment.