diff options
author | biao716.wang <biao716.wang@samsung.com> | 2023-03-03 16:51:24 +0900 |
---|---|---|
committer | biao716.wang <biao716.wang@samsung.com> | 2023-03-10 14:38:18 +0900 |
commit | e806b67f7bf4458450f5d951262ec0aedf7a4a19 (patch) | |
tree | 84575a6945b414287b654aede757583d59d9856e /misc | |
parent | a0dea826f88a4c5c9ceb722592cceedeb75a32fe (diff) | |
download | librpm-tizen-e806b67f7bf4458450f5d951262ec0aedf7a4a19.tar.gz librpm-tizen-e806b67f7bf4458450f5d951262ec0aedf7a4a19.tar.bz2 librpm-tizen-e806b67f7bf4458450f5d951262ec0aedf7a4a19.zip |
Fix build error with Ubuntu22.04tizen/4.11.0.1.tizen20231101
Python bindings: The initialization function must be named PyInit_name(),
where name is the name of the module, and should be the only non-static item defined in the module file
https://github.com/rpm-software-management/rpm/commit/0073376965ee8d8df63c21b0da634fc315c97d0b
related bug: https://bugzilla.redhat.com/show_bug.cgi?id=1064758
Add more patch:
https://github.com/rpm-software-management/rpm/commit/f3801bccb9eb068a747ca63a4b01518a260d9919
https://github.com/rpm-software-management/rpm/commit/ddc7ff28e14064f57c6917e133a95e73f749cf41
https://github.com/rpm-software-management/rpm/commit/2c6e0366ffc6bdbafbdf82df7fcedd975a361465
https://github.com/rpm-software-management/rpm/commit/71527b6fbd2b3898beabd602c462a01b691d67d8
Change-Id: I67a51ee893d06173b3d33d444dfa56a5796523fb
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
Diffstat (limited to 'misc')
-rw-r--r-- | misc/Makefile.am | 2 | ||||
-rw-r--r-- | misc/fts.c | 25 | ||||
-rw-r--r-- | misc/rpmfts.h (renamed from misc/fts.h) | 34 |
3 files changed, 32 insertions, 29 deletions
diff --git a/misc/Makefile.am b/misc/Makefile.am index 4fdde9525..e413a211c 100644 --- a/misc/Makefile.am +++ b/misc/Makefile.am @@ -9,5 +9,5 @@ EXTRA_DIST = \ noinst_LTLIBRARIES = libmisc.la -libmisc_la_SOURCES = fts.c fts.h +libmisc_la_SOURCES = fts.c rpmfts.h libmisc_la_LIBADD = @LTLIBOBJS@ diff --git a/misc/fts.c b/misc/fts.c index 9fbefe3d2..39f059d80 100644 --- a/misc/fts.c +++ b/misc/fts.c @@ -31,41 +31,45 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; #endif /* LIBC_SCCS and not lint */ +/* Conditional to set up proper fstat64 implementation */ +#if defined(hpux) || defined(sun) +# define FTS_FSTAT64(_fd, _sbp) fstat((_fd), (_sbp)) +#else +# define FTS_FSTAT64(_fd, _sbp) fstat64((_fd), (_sbp)) +#endif + #if defined(_LIBC) #include <sys/param.h> #include <include/sys/stat.h> #include <fcntl.h> #include <dirent.h> #include <errno.h> -#include "misc/fts.h" +#include "misc/rpmfts.h" #include <stdlib.h> #include <string.h> #include <unistd.h> #else + +/* Conditionals for working around non-GNU environments */ #if defined(hpux) -# define _INCLUDE_POSIX_SOURCE +# define _INCLUDE_POSIX_SOURCE # define __errno_location() (&errno) # define dirfd(dirp) -1 # define stat64 stat -# define _STAT_VER 0 -# define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp)) #endif #if defined(sun) # define __errno_location() (&errno) # define dirfd(dirp) -1 -# define _STAT_VER 0 -# define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp)) #endif #if defined(__APPLE__) # define __errno_location() (__error()) -# define _STAT_VER 0 -# define __fxstat64(_stat_ver, _fd, _sbp) fstat64((_fd), (_sbp)) #endif + #include "system.h" #include <stdlib.h> #include <string.h> #include <errno.h> -#include "misc/fts.h" +#include "misc/rpmfts.h" # define __set_errno(val) (*__errno_location ()) = (val) # define __open open # define __close close @@ -1118,7 +1122,7 @@ fts_safe_changedir(FTS * sp, FTSENT * p, int fd, const char * path) return (0); if (fd < 0 && (newfd = __open(path, O_RDONLY, 0)) < 0) return (-1); - if (__fxstat64(_STAT_VER, newfd, &sb)) { + if (FTS_FSTAT64(newfd, &sb)) { ret = -1; goto bail; } @@ -1135,3 +1139,4 @@ bail: __set_errno (oerrno); return (ret); } + diff --git a/misc/fts.h b/misc/rpmfts.h index 47c650e7c..0c059cf0c 100644 --- a/misc/fts.h +++ b/misc/rpmfts.h @@ -39,26 +39,19 @@ #else # define __THROW -#ifdef __cplusplus -# define __BEGIN_DECLS extern "C" { -# define __END_DECLS } -#else -# define __BEGIN_DECLS -# define __END_DECLS -#endif -#if defined(hpux) -# define _D_EXACT_NAMLEN(d) ((d)->d_namlen) -# define _INCLUDE_POSIX_SOURCE +#if !defined(_LARGEFILE64_SOURCE) # define _LARGEFILE64_SOURCE #endif -#if defined(sun) -# define _D_EXACT_NAMLEN(d) ((d)->d_reclen) +#if !defined(_D_EXACT_NAMLEN) +# define _D_EXACT_NAMLEN(d) (strlen((d)->d_name)) #endif -#if defined(__APPLE__) -# define _D_EXACT_NAMLEN(d) (strlen((d)->d_name)) +#if defined(hpux) +# if !defined(_INCLUDE_POSIX_SOURCE) +# define _INCLUDE_POSIX_SOURCE +# endif #endif #endif @@ -151,7 +144,9 @@ typedef struct _ftsent { char fts_name[1]; /*!< file name */ } FTSENT; -__BEGIN_DECLS +#ifdef __cplusplus +extern "C" { +#endif /** * Return list of children of the current node. @@ -166,7 +161,7 @@ FTSENT *Fts_children (FTS * sp, int instr) __THROW /** * Destroy a file hierarchy traversal handle. * @param sp file hierarchy state - * @return 0 on sucess, -1 on error + * @return 0 on success, -1 on error */ RPM_GNUC_INTERNAL int Fts_close (FTS * sp) __THROW @@ -198,12 +193,15 @@ FTSENT *Fts_read (FTS * sp) __THROW * @param sp file hierarchy state * @param p file set member * @param instr new disposition for file set member - * @return 0 on sucess, -1 on error + * @return 0 on success, -1 on error */ RPM_GNUC_INTERNAL int Fts_set (FTS * sp, FTSENT * p, int instr) __THROW ; -__END_DECLS +#ifdef __cplusplus +} +#endif #endif /* fts.h */ + |