git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2699
91ce42f0-d328-0410-95d8-
f526ca767f89
WIN32=
MACOSX=
hostname=`uname -n | cut -d '.' -f 1`
WIN32=
MACOSX=
hostname=`uname -n | cut -d '.' -f 1`
-if x${hostname} = x ; then
+if test x${hostname} = x ; then
hostname="localhost"
fi
case "$DISTNAME" in
hostname="localhost"
fi
case "$DISTNAME" in
WIN32=
MACOSX=
hostname=`uname -n | cut -d '.' -f 1`
WIN32=
MACOSX=
hostname=`uname -n | cut -d '.' -f 1`
-if x${hostname} = x ; then
+if test x${hostname} = x ; then
hostname="localhost"
fi
case "$DISTNAME" in
hostname="localhost"
fi
case "$DISTNAME" in
+#ifdef HAVE_WIN32
+#undef open
+#undef read
+#undef write
+#undef lseek
+#undef close
+#undef O_BINARY
+#define open _open
+#define read _read
+#define write _write
+#define lseek _lseeki64
+#define close _close
+#define O_BINARY _O_BINARY
+#endif
+
/*
* Open and read the state file for the daemon
*/
/*
* Open and read the state file for the daemon
*/
Mmsg(&fname, "%s/%s.%d.state", dir, progname, port);
/* If file exists, see what we have */
// Dmsg1(10, "O_BINARY=%d\n", O_BINARY);
Mmsg(&fname, "%s/%s.%d.state", dir, progname, port);
/* If file exists, see what we have */
// Dmsg1(10, "O_BINARY=%d\n", O_BINARY);
- if ((sfd = open(fname, O_RDONLY|O_BINARY, 0)) < 0) {
+ if ((sfd = open(fname, O_RDONLY|O_BINARY)) < 0) {
Dmsg3(010, "Could not open state file. sfd=%d size=%d: ERR=%s\n",
sfd, sizeof(hdr), strerror(errno));
goto bail_out;
Dmsg3(010, "Could not open state file. sfd=%d size=%d: ERR=%s\n",
sfd, sizeof(hdr), strerror(errno));
goto bail_out;
Mmsg(&fname, "%s/%s.%d.state", dir, progname, port);
/* Create new state file */
Mmsg(&fname, "%s/%s.%d.state", dir, progname, port);
/* Create new state file */
if ((sfd = open(fname, O_CREAT|O_WRONLY|O_BINARY, 0640)) < 0) {
berrno be;
Dmsg2(000, "Could not create state file. %s ERR=%s\n", fname, be.strerror());
if ((sfd = open(fname, O_CREAT|O_WRONLY|O_BINARY, 0640)) < 0) {
berrno be;
Dmsg2(000, "Could not create state file. %s ERR=%s\n", fname, be.strerror());