+ T((T_CALLED("_nc_tinfo:doupdate(%p)"), (void *) SP_PARM));
+
+ _nc_lock_global(update);
+
+ if (SP_PARM == 0) {
+ _nc_unlock_global(update);
+ returnCode(ERR);
+ }
+#if !USE_REENTRANT
+ /*
+ * It is "legal" but unlikely that an application could assign a new
+ * value to one of the standard windows. Check for that possibility
+ * and try to recover.
+ *
+ * We do not allow applications to assign new values in the reentrant
+ * model.
+ */
+#if NCURSES_SP_FUNCS
+ if (SP_PARM == CURRENT_SCREEN) {
+#endif
+#define SyncScreens(internal,exported) \
+ if (internal == 0) internal = exported; \
+ if (internal != exported) exported = internal
+
+ SyncScreens(CurScreen(SP_PARM), curscr);
+ SyncScreens(NewScreen(SP_PARM), newscr);
+ SyncScreens(StdScreen(SP_PARM), stdscr);
+#if NCURSES_SP_FUNCS
+ }
+#endif
+#endif /* !USE_REENTRANT */