]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix configure
authorKern Sibbald <kern@sibbald.com>
Wed, 21 Dec 2005 14:28:49 +0000 (14:28 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 21 Dec 2005 14:28:49 +0000 (14:28 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2699 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/autoconf/configure.in
bacula/configure
bacula/src/lib/bsys.c

index 536f4d81576c7f173618872912d582ed57a622c6..44a88459e332833fde88f3ffa287fa302fc608d9 100644 (file)
@@ -1657,7 +1657,7 @@ PSCMD="ps -e"
 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
index 66a8959e035208d8cbf9ed67b7c81ec36c005613..9d85ea7ab17b6cd9b39aeeb3ebd7c2971010597b 100755 (executable)
@@ -29570,7 +29570,7 @@ PSCMD="ps -e"
 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
index 14e51cae1a48ba20fc13476cd88b7f1d5d9728a1..3f6afaa3caf67c14a43d4c1b642da7be5469c67e 100644 (file)
@@ -482,6 +482,21 @@ static struct s_state_hdr state_hdr = {
    0
 };
 
+#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
  */
@@ -497,7 +512,7 @@ void read_state_file(char *dir, const char *progname, int port)
    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;
@@ -543,6 +558,7 @@ void write_state_file(char *dir, const char *progname, int port)
 
    Mmsg(&fname, "%s/%s.%d.state", dir, progname, port);
    /* Create new state file */
+   unlink(fname);
    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());