]> andersk Git - moira.git/blobdiff - update/update_server.c
fixed header again - tom
[moira.git] / update / update_server.c
index ce79b5a53e86fbdbced3d83406cbde7b8ba7506f..54c162e1a866e8ff6b41238e7088b6fb50825321 100644 (file)
@@ -14,11 +14,15 @@ 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 POSIX
+#include <termios.h>
+#endif
 #include "update.h"
 
 extern int auth_001(), inst_001();
@@ -28,7 +32,10 @@ extern int sync_proc(), quit();
 extern char *config_lookup();
 
 extern void gdb_debug();
-extern int exit(), abort(), errno;
+extern int abort(), errno;
+#ifndef sun
+extern int exit();
+#endif
 extern STRING instructions;
 
 CONNECTION conn;
@@ -75,7 +82,7 @@ main(argc, argv)
      gdb_debug(GDB_NOFORK);
 #endif /* DEBUG */
 
-     whoami = rindex(argv[0], '/');
+     whoami = strrchr(argv[0], '/');
      if (whoami)
         whoami++;
      else
@@ -91,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
@@ -156,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.036533 seconds and 4 git commands to generate.