packages/net/sysrepo/patches/005-fix-struct-ucred-define.patch
Rosen Penev 98c04e04c4 sysrepo: Update to 0.7.8
Makefile cleanups for consistency between packages.

Placed libsysrepo in Libraries instead of Utilities.

Removed InstallDev as it is implied by CMAKE_INSTALL.

Added .patch at the end of patch files.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-04 12:05:27 -08:00

28 lines
934 B
Diff

--- a/src/common/sr_utils.c
+++ b/src/common/sr_utils.c
@@ -506,14 +506,24 @@ sr_fd_set_nonblock(int fd)
#if defined(SO_PEERCRED)
+#if defined(__GLIBC__)
#if !defined(SCM_CREDENTIALS)
-/* struct ucred is ifdefined behind __USE_GNU, but __USE_GNU is not defined */
struct ucred {
pid_t pid; /* process ID of the sending process */
uid_t uid; /* user ID of the sending process */
gid_t gid; /* group ID of the sending process */
};
#endif /* !defined(SCM_CREDENTIALS) */
+#else
+#if !defined(_GNU_SOURCE)
+struct ucred {
+ pid_t pid; /* process ID of the sending process */
+ uid_t uid; /* user ID of the sending process */
+ gid_t gid; /* group ID of the sending process */
+};
+/* struct ucred is ifdefined behind __USE_GNU, but __USE_GNU is not defined */
+#endif /* !defined(__GNU_SOURCE) */
+#endif /* defined(__GLIBC__) */
int
sr_get_peer_eid(int fd, uid_t *uid, gid_t *gid)