5.5.2-glibc.patch 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. diff -Naur common-orig/Makefile umoria/unix/Makefile
  2. --- common-orig/Makefile 2003-12-09 10:06:19.000000000 -0500
  3. +++ umoria/unix/Makefile 2003-12-09 10:07:12.000000000 -0500
  4. @@ -14,9 +14,9 @@
  5. CFLAGS = -O
  6. # For BSD Systems
  7. -CURSES = -lcurses -ltermcap
  8. +# CURSES = -lcurses -ltermcap
  9. # For SYS V Systems
  10. -# CURSES = -lcurses
  11. +CURSES = `pkg-config ncurses --libs`
  12. # For XENIX, some XENIX systems may need -ltinfo
  13. # CURSES = -ltcap -ltermcap -lx
  14. diff -Naur common-orig/death.c umoria/source/death.c
  15. --- common-orig/death.c 2003-12-09 10:06:19.000000000 -0500
  16. +++ umoria/source/death.c 2003-12-09 10:06:56.000000000 -0500
  17. @@ -175,10 +175,12 @@
  18. /* The following code is provided especially for systems which -CJS-
  19. have no flock system call. It has never been tested. */
  20. +#ifndef LOCK_EX
  21. #define LOCK_EX 1
  22. #define LOCK_SH 2
  23. #define LOCK_NB 4
  24. #define LOCK_UN 8
  25. +#endif
  26. /* An flock HACK. LOCK_SH and LOCK_EX are not distinguished. DO NOT release
  27. a lock which you failed to set! ALWAYS release a lock you set! */
  28. diff -Naur common-orig/io.c umoria/source/io.c
  29. --- common-orig/io.c 2003-12-09 10:06:19.000000000 -0500
  30. +++ umoria/source/io.c 2003-12-09 10:06:56.000000000 -0500
  31. @@ -62,6 +62,7 @@
  32. #include <ctype.h>
  33. +#include <termios.h>
  34. #if defined(SYS_V) && defined(lint)
  35. /* for AIX, prevent hundreds of unnecessary lint errors, must define before
  36. @@ -334,7 +335,9 @@
  37. #ifdef __386BSD__
  38. (void) signal (SIGTSTP, (sig_t)suspend);
  39. #else
  40. - (void) signal (SIGTSTP, suspend);
  41. + /* (void) signal (SIGTSTP, suspend); */
  42. + /* libc6 defaults to BSD, this expects SYSV */
  43. + (void) sysv_signal (SIGTSTP, suspend);
  44. #endif
  45. #endif
  46. #endif
  47. diff -Naur common-orig/misc3.c umoria/source/misc3.c
  48. --- common-orig/misc3.c 2003-12-09 10:06:19.000000000 -0500
  49. +++ umoria/source/misc3.c 2003-12-09 10:06:56.000000000 -0500
  50. @@ -1249,8 +1249,7 @@
  51. {
  52. int i;
  53. register inven_type *i_ptr;
  54. - vtype prt2;
  55. - bigvtype prt1;
  56. + bigvtype prt1, prt2;
  57. #ifdef ATARIST_MWC
  58. int32u holder;
  59. #endif
  60. diff -Naur common-orig/misc4.c umoria/source/misc4.c
  61. --- common-orig/misc4.c 2003-12-09 10:06:19.000000000 -0500
  62. +++ umoria/source/misc4.c 2003-12-09 10:06:56.000000000 -0500
  63. @@ -33,7 +33,7 @@
  64. void scribe_object()
  65. {
  66. int item_val, j;
  67. - vtype out_val, tmp_str;
  68. + bigvtype out_val, tmp_str;
  69. if (inven_ctr > 0 || equip_ctr > 0)
  70. {
  71. diff -Naur common-orig/moria1.c umoria/source/moria1.c
  72. --- common-orig/moria1.c 2003-12-09 10:06:19.000000000 -0500
  73. +++ umoria/source/moria1.c 2003-12-09 10:06:56.000000000 -0500
  74. @@ -332,8 +332,8 @@
  75. {
  76. objdes(tmp_val, &inventory[i], TRUE);
  77. tmp_val[lim] = 0; /* Truncate if too long. */
  78. - (void) sprintf(out_val[i], " %c) %s", 'a'+i, tmp_val);
  79. - l = strlen(out_val[i]);
  80. + (void) sprintf(out_val[i], "%c) %s", 'a'+i, tmp_val);
  81. + l = strlen(out_val[i]) + 2;
  82. if (weight)
  83. l += 9;
  84. if (l > len)
  85. @@ -352,9 +352,12 @@
  86. {
  87. /* don't need first two spaces if in first column */
  88. if (col == 0)
  89. - prt(&out_val[i][2], current_line, col);
  90. - else
  91. prt(out_val[i], current_line, col);
  92. + else
  93. + {
  94. + put_buffer(" ", current_line, col);
  95. + prt(out_val[i], current_line, col+2);
  96. + }
  97. if (weight)
  98. {
  99. total_weight = inventory[i].weight*inventory[i].number;
  100. @@ -466,9 +469,9 @@
  101. }
  102. objdes(prt2, &inventory[i], TRUE);
  103. prt2[lim] = 0; /* Truncate if necessary */
  104. - (void) sprintf(out_val[line], " %c) %-14s: %s", line+'a',
  105. - prt1, prt2);
  106. - l = strlen(out_val[line]);
  107. + (void) sprintf(out_val[line], "%c) %-14s: %s", line+'a',
  108. + prt1, prt2);
  109. + l = strlen(out_val[line]) + 2;
  110. if (weight)
  111. l += 9;
  112. if (l > len)
  113. @@ -488,9 +491,12 @@
  114. {
  115. /* don't need first two spaces when using whole screen */
  116. if (col == 0)
  117. - prt(&out_val[line][2], line+1, col);
  118. - else
  119. prt(out_val[line], line+1, col);
  120. + else
  121. + {
  122. + put_buffer(" ", line+1, col);
  123. + prt(out_val[line], line+1, col+2);
  124. + }
  125. if (weight)
  126. {
  127. total_weight = i_ptr->weight*i_ptr->number;
  128. diff -Naur common-orig/signals.c umoria/source/signals.c
  129. --- common-orig/signals.c 2003-12-09 10:06:19.000000000 -0500
  130. +++ umoria/source/signals.c 2003-12-09 10:06:56.000000000 -0500
  131. @@ -113,7 +113,11 @@
  132. if(error_sig >= 0) /* Ignore all second signals. */
  133. {
  134. if(++signal_count > 10) /* Be safe. We will die if persistent enough. */
  135. +#ifdef __FreeBSD__
  136. (void) signal(sig, SIG_DFL);
  137. +#else
  138. + (void) sysv_signal(sig, SIG_DFL);
  139. +#endif
  140. return;
  141. }
  142. error_sig = sig;
  143. @@ -126,7 +126,11 @@
  144. )
  145. {
  146. if (death)
  147. +#ifdef __FreeBSD__
  148. (void) signal(sig, SIG_IGN); /* Can't quit after death. */
  149. +#else
  150. + (void) sysv_signal(sig, SIG_IGN); /* Can't quit after death. */
  151. +#endif
  152. else if (!character_saved && character_generated)
  153. {
  154. if (!get_check("Really commit *Suicide*?"))
  155. @@ -137,7 +137,11 @@
  156. put_qio();
  157. error_sig = -1;
  158. #ifdef USG
  159. +#ifdef __FreeBSD__
  160. (void) signal(sig, signal_handler);/* Have to restore handler. */
  161. +#else
  162. + (void) sysv_signal(sig, signal_handler);/* Have to restore handler. */
  163. +#endif
  164. #else
  165. (void) sigsetmask(smask);
  166. #endif
  167. @@ -179,7 +179,11 @@
  168. restore_term();
  169. #if !defined(MSDOS) && !defined(AMIGA) && !defined(ATARIST_TC)
  170. /* always generate a core dump */
  171. +#ifdef __FreeBSD__
  172. (void) signal(sig, SIG_DFL);
  173. +#else
  174. + (void) sysv_signal(sig, SIG_DFL);
  175. +#endif
  176. (void) kill(getpid(), sig);
  177. (void) sleep(5);
  178. #endif
  179. @@ -199,7 +199,11 @@
  180. #if defined(atarist) && defined(__GNUC__)
  181. (void) signal(SIGTSTP, (__Sigfunc)SIG_IGN);
  182. #else
  183. +#ifdef __FreeBSD__
  184. (void) signal(SIGTSTP, SIG_IGN);
  185. +#else
  186. + (void) sysv_signal(SIGTSTP, SIG_IGN);
  187. +#endif
  188. #endif
  189. #ifndef USG
  190. mask = sigsetmask(0);
  191. @@ -220,7 +220,11 @@
  192. #ifdef __386BSD__
  193. (void) signal(SIGTSTP, (sig_t)suspend);
  194. #else
  195. +#ifdef __FreeBSD__
  196. (void) signal(SIGTSTP, suspend);
  197. +#else
  198. + (void) sysv_signal(SIGTSTP, suspend);
  199. +#endif
  200. #endif
  201. #endif
  202. #ifndef USG
  203. @@ -237,7 +237,11 @@
  204. {
  205. #if !defined(ATARIST_MWC) && !defined(ATARIST_TC)
  206. /* No signals for Atari ST compiled with MWC or TC. */
  207. +#ifdef __FreeBSD__
  208. (void) signal(SIGINT, signal_handler);
  209. +#else
  210. + (void) sysv_signal(SIGINT, signal_handler);
  211. +#endif
  212. #if defined(atarist) && defined(__GNUC__)
  213. /* Atari ST compiled with GNUC has most signals, but we need a cast
  214. @@ -259,8 +259,13 @@
  215. #else
  216. /* Everybody except the atari st. */
  217. +#ifdef __FreeBSD__
  218. (void) signal(SIGINT, signal_handler);
  219. (void) signal(SIGFPE, signal_handler);
  220. +#else
  221. + (void) sysv_signal(SIGINT, signal_handler);
  222. + (void) sysv_signal(SIGFPE, signal_handler);
  223. +#endif
  224. #if defined(MSDOS)
  225. /* many fewer signals under MSDOS */
  226. @@ -278,30 +278,61 @@
  227. /* Everybody except Atari, MSDOS, and Amiga. */
  228. /* Ignore HANGUP, and let the EOF code take care of this case. */
  229. +#ifdef __FreeBSD__
  230. (void) signal(SIGHUP, SIG_IGN);
  231. (void) signal(SIGQUIT, signal_handler);
  232. (void) signal(SIGILL, signal_handler);
  233. (void) signal(SIGTRAP, signal_handler);
  234. (void) signal(SIGIOT, signal_handler);
  235. +#else
  236. + (void) sysv_signal(SIGHUP, SIG_IGN);
  237. + (void) sysv_signal(SIGQUIT, signal_handler);
  238. + (void) sysv_signal(SIGILL, signal_handler);
  239. + (void) sysv_signal(SIGTRAP, signal_handler);
  240. + (void) sysv_signal(SIGIOT, signal_handler);
  241. +#endif
  242. #ifdef SIGEMT /* in BSD systems */
  243. (void) signal(SIGEMT, signal_handler);
  244. #endif
  245. #ifdef SIGDANGER /* in SYSV systems */
  246. (void) signal(SIGDANGER, signal_handler);
  247. #endif
  248. +#ifdef __FreeBSD__
  249. (void) signal(SIGKILL, signal_handler);
  250. (void) signal(SIGBUS, signal_handler);
  251. (void) signal(SIGSEGV, signal_handler);
  252. +#else
  253. + (void) sysv_signal(SIGKILL, signal_handler);
  254. + (void) sysv_signal(SIGBUS, signal_handler);
  255. + (void) sysv_signal(SIGSEGV, signal_handler);
  256. +#endif
  257. #ifdef SIGSYS
  258. +#ifdef __FreeBSD__
  259. (void) signal(SIGSYS, signal_handler);
  260. +#else
  261. + (void) sysv_signal(SIGSYS, signal_handler);
  262. +#endif
  263. #endif
  264. +#ifdef __FreeBSD__
  265. (void) signal(SIGTERM, signal_handler);
  266. (void) signal(SIGPIPE, signal_handler);
  267. +#else
  268. + (void) sysv_signal(SIGTERM, signal_handler);
  269. + (void) sysv_signal(SIGPIPE, signal_handler);
  270. +#endif
  271. #ifdef SIGXCPU /* BSD */
  272. +#ifdef __FreeBSD__
  273. (void) signal(SIGXCPU, signal_handler);
  274. +#else
  275. + (void) sysv_signal(SIGXCPU, signal_handler);
  276. +#endif
  277. #endif
  278. #ifdef SIGPWR /* SYSV */
  279. +#ifdef __FreeBSD__
  280. (void) signal(SIGPWR, signal_handler);
  281. +#else
  282. + (void) sysv_signal(SIGPWR, signal_handler);
  283. +#endif
  284. #endif
  285. #endif
  286. #endif
  287. @@ -314,7 +314,11 @@
  288. #if !defined(ATARIST_MWC)
  289. (void) signal(SIGINT, SIG_IGN);
  290. #ifdef SIGQUIT
  291. +#ifdef __FreeBSD__
  292. (void) signal(SIGQUIT, SIG_IGN);
  293. +#else
  294. + (void) sysv_signal(SIGQUIT, SIG_IGN);
  295. +#endif
  296. #endif
  297. #endif
  298. }
  299. @@ -324,7 +324,11 @@
  300. #if !defined(ATARIST_MWC)
  301. (void) signal(SIGINT, SIG_DFL);
  302. #ifdef SIGQUIT
  303. +#ifdef __FreeBSD__
  304. (void) signal(SIGQUIT, SIG_DFL);
  305. +#else
  306. + (void) sysv_signal(SIGQUIT, SIG_DFL);
  307. +#endif
  308. #endif
  309. #endif
  310. }
  311. @@ -335,13 +335,21 @@
  312. #if defined(atarist) && defined(__GNUC__)
  313. (void) signal(SIGINT, (__Sigfunc)signal_handler);
  314. #else
  315. +#ifdef __FreeBSD__
  316. (void) signal(SIGINT, signal_handler);
  317. +#else
  318. + (void) sysv_signal(SIGINT, signal_handler);
  319. +#endif
  320. #endif
  321. #ifdef SIGQUIT
  322. #if defined(atarist) && defined(__GNUC__)
  323. (void) signal(SIGQUIT, (__Sigfunc)signal_handler);
  324. #else
  325. +#ifdef __FreeBSD__
  326. (void) signal(SIGQUIT, signal_handler);
  327. +#else
  328. + (void) sysv_signal(SIGQUIT, signal_handler);
  329. +#endif
  330. #endif
  331. #endif
  332. #endif
  333. diff -Naur common-orig/unix.c umoria/unix/unix.c
  334. --- common-orig/unix.c 2003-12-09 10:06:19.000000000 -0500
  335. +++ umoria/unix/unix.c 2003-12-09 10:06:56.000000000 -0500
  336. @@ -261,7 +261,7 @@
  337. #endif
  338. #ifdef USG
  339. -unsigned short getuid();
  340. +/* unsigned short getuid(); */
  341. #else
  342. #ifndef SECURE
  343. #ifdef BSD4_3