OSDN Git Service

[Refactor] #37353 System III Unixに関するプリプロUSGを削除/ Removed preprocessor USG (System...
authorHourier <hourier@users.sourceforge.jp>
Tue, 28 Jan 2020 12:49:59 +0000 (21:49 +0900)
committerHourier <hourier@users.sourceforge.jp>
Tue, 28 Jan 2020 12:49:59 +0000 (21:49 +0900)
src/h-system.h
src/main-cap.c
src/main-gcu.c
src/util.c

index 1387ba0..ec7bbcd 100644 (file)
 
 #ifdef SET_UID
 
-# ifndef USG
 #  include <sys/param.h>
 #  include <sys/file.h>
-# endif /* !USG */
 
 # ifdef linux
 #  include <sys/file.h>
index 0190dd2..89ba274 100644 (file)
@@ -46,7 +46,7 @@
 #  if defined(_POSIX_VERSION)
 #   define USE_TPOSIX
 #  else
-#   if defined(USG) || defined(linux)
+#   if defined(linux)
 #    define USE_TERMIO
 #   else
 #    define USE_TCHARS
index ad2f4dd..47c2a96 100644 (file)
@@ -203,7 +203,7 @@ static term_data data[MAX_TERM_DATA];
 #  if defined(_POSIX_VERSION)
 #   define USE_TPOSIX
 #  else
-#   if defined(USG) || defined(linux)
+#   if defined(linux)
 #    define USE_TERMIO
 #   else
 #    define USE_TCHARS
@@ -1297,13 +1297,8 @@ errr init_gcu(int argc, char *argv[])
    /* Extract the normal keymap */
    keymap_norm_prepare();
 
-#if defined(USG)
-   /* Initialize for USG Unix */
-   if (initscr() == NULL) return (-1);
-#else
    /* Initialize for others systems */
    if (initscr() == (WINDOW*)ERR) return (-1);
-#endif
 
    /* Activate hooks */
    quit_aux = hook_quit;
index b26f9a8..560c927 100644 (file)
@@ -772,32 +772,7 @@ errr fd_lock(int fd, int what)
        /* Verify the fd */
        if (fd < 0) return -1;
 
-#ifdef SET_UID
-
-# ifdef USG
-
-#  if defined(F_ULOCK) && defined(F_LOCK)
-
-       /* Un-Lock */
-       if (what == F_UNLCK)
-       {
-               /* Unlock it, Ignore errors */
-               lockf(fd, F_ULOCK, 0);
-       }
-
-       /* Lock */
-       else
-       {
-               /* Lock the score file */
-               if (lockf(fd, F_LOCK, 0) != 0) return 1;
-       }
-
-#  endif
-
-# else
-
-#  if defined(LOCK_UN) && defined(LOCK_EX)
-
+#if defined(SET_UID) && defined(LOCK_UN) && defined(LOCK_EX)
        /* Un-Lock */
        if (what == F_UNLCK)
        {
@@ -811,11 +786,6 @@ errr fd_lock(int fd, int what)
                /* Lock the score file */
                if (flock(fd, LOCK_EX) != 0) return 1;
        }
-
-#  endif
-
-# endif
-
 #endif
 
        /* Success */