Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fixes SIGSEGV, 64-bit format specifiers, dlsym bug and IPC on Windows #34

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+25 −13
Split
View
@@ -11317,13 +11317,21 @@ $2 == "bozo" { t = $1
_fmt='"ld"'
;;
'long long'|'long long int')
- _fmt='"lld"'
+ if test $target_os = mingw; then
+ _fmt='"I64d"'
+ else
+ _fmt='"lld"'
+ fi
;;
'unsigned long'|'unsigned long int'|'long unsigned int')
_fmt='"lu"'
;;
'unsigned long long')
- _fmt='"llu"'
+ if test $target_os = mingw; then
+ _fmt='"I64u"'
+ else
+ _fmt='"llu"'
+ fi
;;
*\*) # pointer to a something
_fmt='"p"'
View
@@ -1821,13 +1821,21 @@ $2 == "bozo" { t = $1
_fmt='"ld"'
;;
'long long'|'long long int')
- _fmt='"lld"'
+ if test $target_os = mingw; then
+ _fmt='"I64d"'
+ else
+ _fmt='"lld"'
+ fi
;;
'unsigned long'|'unsigned long int'|'long unsigned int')
_fmt='"lu"'
;;
'unsigned long long')
- _fmt='"llu"'
+ if test $target_os = mingw; then
+ _fmt='"I64u"'
+ else
+ _fmt='"llu"'
+ fi
;;
*\*) # pointer to a something
_fmt='"p"'
@@ -570,12 +570,6 @@ extern const char *wsastrerror(int);
#define SIGHUP (NSIG+1)
#define SIGUSR1 (NSIG+2)
#define SIGBUS (NSIG+3)
-#define S_IRGRP 0
-#define S_IWGRP 0
-#define S_IROTH 0
-#define S_IWOTH 0
-#define S_IRWXG 0
-#define S_IRWXO 0
#define S_ISVTX 0
#define fcntl(f, cmd, ...) 0
@@ -630,6 +630,7 @@ OpenRequestPorts(__pmFdSet *fdset, int backlog)
}
}
+#ifndef IS_MINGW
/* Open a local unix domain socket, if specified, and supported. */
if (localSocketPath != NULL) {
#if defined(HAVE_STRUCT_SOCKADDR_UN)
@@ -644,6 +645,7 @@ OpenRequestPorts(__pmFdSet *fdset, int backlog)
pmProgname);
#endif
}
+#endif
if (success)
return maximum;
View
@@ -89,7 +89,7 @@ __pmSetSignalHandler(int sig, __pmSignalHandler func)
char *signame, evname[64];
HANDLE eventhdl, waithdl;
- if ((signame = MapSignals(sig, &index)) < 0)
+ if ((signame = MapSignals(sig, &index)) == NULL)
return index;
if (signals[index].callback) { /* remove old handler */
View
@@ -1995,8 +1995,8 @@ GetAgentDso(AgentInfo *aPtr)
#if defined(HAVE_DLOPEN)
dlerror();
dso->initFn = (void (*)(pmdaInterface*))dlsym(dso->dlHandle, dso->entryPoint);
- dlerrstr = dlerror();
- if (dlerrstr != NULL) {
+ if (dso->initFn == NULL) {
+ dlerrstr = dlerror();
fprintf(stderr, "Couldn't find init function `%s' in %s DSO: %s\n",
dso->entryPoint, aPtr->pmDomainLabel, dlerrstr);
dlclose(dso->dlHandle);