buf = malloc(size);
if (buf == NULL) {
- Emsg1(M_ABORT, 0, _("Out of memory: ERR=%s\n"), strerror(errno));
+ berrno be;
+ Emsg1(M_ABORT, 0, _("Out of memory: ERR=%s\n"), be.strerror());
}
return buf;
}
buf = malloc(size);
#endif
if (buf == NULL) {
- e_msg(file, line, M_ABORT, 0, _("Out of memory: ERR=%s\n"), strerror(errno));
+ berrno be;
+ e_msg(file, line, M_ABORT, 0, _("Out of memory: ERR=%s\n"), be.strerror());
}
return buf;
}
{
buf = realloc(buf, size);
if (buf == NULL) {
- Emsg1(M_ABORT, 0, _("Out of memory: ERR=%s\n"), strerror(errno));
+ berrno be;
+ Emsg1(M_ABORT, 0, _("Out of memory: ERR=%s\n"), be.strerror());
}
return buf;
}
buf = calloc(size1, size2);
if (buf == NULL) {
- Emsg1(M_ABORT, 0, _("Out of memory: ERR=%s\n"), strerror(errno));
+ berrno be;
+ Emsg1(M_ABORT, 0, _("Out of memory: ERR=%s\n"), be.strerror());
}
return buf;
}
{
int errstat;
+ /* Note, this trylock *should* fail if the mutex is locked */
if ((errstat=pthread_mutex_trylock(m)) == 0) {
berrno be;
e_msg(file, line, M_ERROR, 0, _("Mutex unlock not locked. ERR=%s\n"),
}
#endif
-#if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
+#if !defined(HAVE_WIN32)
static int del_pid_file_ok = FALSE;
#endif
*/
void create_pid_file(char *dir, const char *progname, int port)
{
-#if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
+#if !defined(HAVE_WIN32)
int pidfd, len;
int oldpid;
char pidbuf[20];
*/
int delete_pid_file(char *dir, const char *progname, int port)
{
-#if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
+#if !defined(HAVE_WIN32)
POOLMEM *fname = get_pool_memory(PM_FNAME);
if (!del_pid_file_ok) {