File tree Expand file tree Collapse file tree 2 files changed +35
-19
lines changed Expand file tree Collapse file tree 2 files changed +35
-19
lines changed Original file line number Diff line number Diff line change 2323#include <sys/types.h>
2424#include <sys/socket.h>
2525#include <netinet/in.h>
26- #include <sys/stat.h>
27- #include <EventLogger.hpp>
28-
29- extern EventLogger * g_eventLogger ;
3026
3127#define MY_SOCKET_FORMAT "%d"
3228#define MY_SOCKET_FORMAT_VALUE (x ) (x.fd)
@@ -63,20 +59,8 @@ static inline int my_socket_get_fd(ndb_socket_t s)
6359 return s .fd ;
6460}
6561
66- static inline int my_socket_close (ndb_socket_t s )
67- {
68- struct stat sb ;
69- if (fstat (s .fd , & sb ) == 0 )
70- {
71- if ((sb .st_mode & S_IFMT ) != S_IFSOCK )
72- {
73- g_eventLogger -> error ("fd=%d: not socket: mode=%o" ,
74- s .fd , sb .st_mode );
75- abort ();
76- }
77- }
78- return close (s .fd );
79- }
62+ /* implemented in ndb_socket.cpp */
63+ extern int my_socket_close (ndb_socket_t s );
8064
8165static inline int my_socket_errno ()
8266{
Original file line number Diff line number Diff line change 11/*
2- Copyright (c) 2009, 2010 , Oracle and/or its affiliates. All rights reserved.
2+ Copyright (c) 2009, 2015 , Oracle and/or its affiliates. All rights reserved.
33
44 This program is free software; you can redistribute it and/or modify
55 it under the terms of the GNU General Public License as published by
1919#include " m_string.h"
2020#include " ndb_socket.h"
2121
22+ /*
23+ Implement my_socket_close here to avoid EventLogger.hpp in
24+ header file (causes unrelated link problem on Solaris).
25+ */
26+
27+ #if defined _WIN32
28+
29+ /* skip */
30+
31+ #else
32+
33+ #include < sys/stat.h>
34+ #include < EventLogger.hpp>
35+
36+ extern EventLogger* g_eventLogger;
37+
38+ int my_socket_close (ndb_socket_t s)
39+ {
40+ struct stat sb;
41+ if (fstat (s.fd , &sb) == 0 )
42+ {
43+ if ((sb.st_mode & S_IFMT) != S_IFSOCK)
44+ {
45+ g_eventLogger->error (" fd=%d: not socket: mode=%o" ,
46+ s.fd , sb.st_mode );
47+ abort ();
48+ }
49+ }
50+ return close (s.fd );
51+ }
52+
53+ #endif
2254
2355/*
2456 Implement my_socketpair() so that it works both on UNIX and windows
You can’t perform that action at this time.
0 commit comments