}
#endif
-void *b_malloc(char *file, int line, size_t size)
+void *b_malloc(const char *file, int line, size_t size)
{
void *buf;
/*
* Implement snprintf
*/
-int bsnprintf(char *str, size_t size, const char *fmt, ...)
+int bsnprintf(char *str, int32_t size, const char *fmt, ...)
{
#ifdef HAVE_VSNPRINTF
va_list arg_ptr;
/*
* Implement vsnprintf()
*/
-int bvsnprintf(char *str, size_t size, const char *format, va_list ap)
+int bvsnprintf(char *str, int32_t size, const char *format, va_list ap)
{
#ifdef HAVE_VSNPRINTF
int len;
#endif /* HAVE_LOCALTIME_R */
#ifndef HAVE_READDIR_R
-
+#ifndef HAVE_WIN32
#include <dirent.h>
int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)
}
V(mutex);
return stat;
-}
+}
+#endif
#endif /* HAVE_READDIR_R */
#ifdef xxxxxxxxxx_STRERROR_R
}
#endif /* DEBUG_MUTEX */
-#ifndef HAVE_CYGWIN
+#if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
static int del_pid_file_ok = FALSE;
#endif
*/
void create_pid_file(char *dir, char *progname, int port)
{
-#ifndef HAVE_CYGWIN
+#if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
int pidfd, len;
int oldpid;
char pidbuf[20];
*/
int delete_pid_file(char *dir, char *progname, int port)
{
-#ifndef HAVE_CYGWIN
+#if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
POOLMEM *fname = get_pool_memory(PM_FNAME);
if (!del_pid_file_ok) {
static pthread_cond_t timer = PTHREAD_COND_INITIALIZER;
/*
- * This routine will sleep (sec, msec). Note, however, that if a
+ * This routine will sleep (sec, microsec). Note, however, that if a
* signal occurs, it will return early. It is up to the caller
* to recall this routine if he/she REALLY wants to sleep the
* requested time.
*/
-int bmicrosleep(time_t sec, long msec)
+int bmicrosleep(time_t sec, long usec)
{
struct timespec timeout;
struct timeval tv;
int stat;
timeout.tv_sec = sec;
- timeout.tv_nsec = msec * 1000;
+ timeout.tv_nsec = usec * 1000;
#ifdef HAVE_NANOSLEEP
stat = nanosleep(&timeout, NULL);
* Bacula's implementation of fgets(). The difference is that it handles
* being interrupted by a signal (e.g. a SIGCHLD).
*/
-#undef bfgets
+#undef fgetc
char *bfgets(char *s, int size, FILE *fd)
{
char *p = s;