swrap: Fix prototype of open[64] to prevent segfault on ppc64le
authorAndreas Schneider <asn@samba.org>
Wed, 2 Aug 2017 11:21:59 +0000 (13:21 +0200)
committerAndreas Schneider <asn@samba.org>
Thu, 7 Sep 2017 05:57:25 +0000 (07:57 +0200)
The calling conventions for vaarg are different on ppc64le. The patch
fixes segfaults on that platform.

Thanks to Florian Weimer who helped debugging it!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
src/socket_wrapper.c

index d95dbc03b02cf8dcd2864944c51ff5f752a50a24..ccbe67f09709883dc5f9b5fa992010c5bb7076ff 100644 (file)
@@ -442,9 +442,9 @@ typedef int (*__libc_getsockopt)(int sockfd,
                               socklen_t *optlen);
 typedef int (*__libc_ioctl)(int d, unsigned long int request, ...);
 typedef int (*__libc_listen)(int sockfd, int backlog);
-typedef int (*__libc_open)(const char *pathname, int flags, mode_t mode);
+typedef int (*__libc_open)(const char *pathname, int flags, ...);
 #ifdef HAVE_OPEN64
-typedef int (*__libc_open64)(const char *pathname, int flags, mode_t mode);
+typedef int (*__libc_open64)(const char *pathname, int flags, ...);
 #endif /* HAVE_OPEN64 */
 typedef int (*__libc_openat)(int dirfd, const char *path, int flags, ...);
 typedef int (*__libc_pipe)(int pipefd[2]);