]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/lib_setup.c
ncurses 6.3 - patch 20220813
[ncurses.git] / ncurses / tinfo / lib_setup.c
index 434d5633a7dcb8388e8eceb43b82c1b233c0d4b0..db93a368fda162022a48dda6edda2468e41140f7 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey                                *
+ * Copyright 2018-2021,2022 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -49,7 +49,7 @@
 #include <locale.h>
 #endif
 
-MODULE_ID("$Id: lib_setup.c,v 1.215 2021/11/20 23:11:31 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.218 2022/08/13 18:12:22 tom Exp $")
 
 /****************************************************************************
  *
@@ -831,7 +831,7 @@ TINFO_SETUP_TERM(TERMINAL **tp,
        if (NC_ISATTY(Filedes)) {
            NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG);
            NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG);
-           baudrate();
+           NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG);
        }
        code = OK;
 #endif
@@ -908,6 +908,7 @@ _nc_forget_prescr(void)
 {
     PRESCREEN_LIST *p, *q;
     pthread_t id = GetThreadID();
+    _nc_lock_global(screen);
     for (p = _nc_prescreen.allocated, q = 0; p != 0; q = p, p = p->next) {
        if (p->id == id) {
            if (q) {
@@ -919,6 +920,7 @@ _nc_forget_prescr(void)
            break;
        }
     }
+    _nc_unlock_global(screen);
 }
 #endif /* USE_PTHREADS */
 
@@ -990,6 +992,7 @@ _nc_setupterm(const char *tname,
     int rc = ERR;
     TERMINAL *termp = 0;
 
+    _nc_init_pthreads();
     _nc_lock_global(prescreen);
     START_TRACE();
     if (TINFO_SETUP_TERM(&termp, tname, Filedes, errret, reuse) == OK) {
@@ -999,6 +1002,7 @@ _nc_setupterm(const char *tname,
        }
     }
     _nc_unlock_global(prescreen);
+
     return rc;
 }
 #endif