]> andersk Git - moira.git/blobdiff - update/update_server.c
#define MR_INGRES_ERR and MR_INGRES_SOFTFAIL for backward compatibility
[moira.git] / update / update_server.c
index 9f45d8701d1660f2b1be3376cd0baf26beb8129d..54c162e1a866e8ff6b41238e7088b6fb50825321 100644 (file)
@@ -14,13 +14,13 @@ static char *rcsid_dispatch_c = "$Header$";
 #include <stdio.h>
 #include <gdb.h>
 #include <errno.h>
-#include <strings.h>
+#include <string.h>
 #include <pwd.h>
 #include <moira.h>
 #include <sys/file.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
-#ifdef SOLARIS
+#ifdef POSIX
 #include <termios.h>
 #endif
 #include "update.h"
@@ -82,7 +82,7 @@ main(argc, argv)
      gdb_debug(GDB_NOFORK);
 #endif /* DEBUG */
 
-     whoami = rindex(argv[0], '/');
+     whoami = strrchr(argv[0], '/');
      if (whoami)
         whoami++;
      else
@@ -98,11 +98,15 @@ main(argc, argv)
      if (!config_lookup("nofork")) {
         if (fork())
           exit(0);
+#ifdef POSIX
+        setsid();
+#else
         n = open("/dev/tty", O_RDWR|FNDELAY);
         if (n > 0) {
             (void) ioctl(n, TIOCNOTTY, (char *)NULL);
             (void) close(n);
         }
+#endif
      } else
        gdb_debug(GDB_NOFORK);
 #endif
@@ -163,7 +167,7 @@ main(argc, argv)
              sever_connection(conn);
              exit(1);
          }
-         cp = index(STRING_DATA(str), ' ');
+         cp = strchr(STRING_DATA(str), ' ');
          if (cp)
               *cp = '\0';
          for (d = dispatch_table; d->str; d++) {
This page took 0.068724 seconds and 4 git commands to generate.