OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.5 KiB

  1. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # T2 SDE: package/.../dietlibc/patches/pkg_kiss.patch
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. # Copyright (C) 1998 - 2004 Clifford Wolf
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This patch file is dual-licensed. It is available under the license the
  11. # patched project is licensed under, as long as it is an OpenSource license
  12. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  13. # of the GNU General Public License as published by the Free Software
  14. # Foundation; either version 2 of the License, or (at your option) any later
  15. # version.
  16. # --- T2-COPYRIGHT-NOTE-END ---
  17. The dietlibc getcwd function does not (yet) support the GNU extension to
  18. allocate the string on-the-fly. So we use some sub-optimal aolution and
  19. additional checks. WAIT_ANY should also be added to the dietlibc ...
  20. Rene Rebe <rene@exactcode.de>
  21. diff -ur kiss-0.21/src/getprompt.c src.kiss.-1.25906.3396530713/kiss-0.21/src/getprompt.c
  22. --- kiss-0.21/src/getprompt.c 1998-09-25 14:07:10.000000000 +0200
  23. +++ kiss-0.21/src/getprompt.c 2003-08-18 02:12:51.000000000 +0200
  24. @@ -3,14 +3,14 @@
  25. char *getprompt ()
  26. {
  27. register char
  28. - *prompt,
  29. - *cwd;
  30. + *prompt;
  31. static char
  32. - buf [LINELEN];
  33. + buf [LINELEN],
  34. + cwd [LINELEN];
  35. char
  36. twobuf [2] = { 0, 0 };
  37. - cwd = getcwd (NULL, 0);
  38. + getcwd (cwd, LINELEN);
  39. if (! flags.noenviron)
  40. addtoenv ("PWD", cwd);
  41. @@ -33,22 +33,22 @@
  42. strcat (buf, username);
  43. break;
  44. case 'p':
  45. - strcat (buf, cwd);
  46. + if (cwd)
  47. + strcat (buf, cwd);
  48. break;
  49. default:
  50. - twobuf [0] = *prompt;
  51. - strcat (buf, twobuf);
  52. + strcat (buf, prompt);
  53. }
  54. }
  55. else
  56. {
  57. - twobuf [0] = *prompt;
  58. + twobuf [0] = *prompt;
  59. strcat (buf, twobuf);
  60. }
  61. prompt++;
  62. }
  63. - free (cwd);
  64. + /*free (cwd);*/
  65. return (buf);
  66. }
  67. diff -ur kiss-0.21/src/waitforchild.c src.kiss.-1.25906.3396530713/kiss-0.21/src/waitforchild.c
  68. --- kiss-0.21/src/waitforchild.c 1998-09-25 14:07:10.000000000 +0200
  69. +++ kiss-0.21/src/waitforchild.c 2003-08-17 23:16:10.000000000 +0200
  70. @@ -31,7 +31,7 @@
  71. reportstatus (childname, status, background);
  72. /* let's see how generic kids are doing */
  73. - while ( (pid = waitpid (WAIT_ANY, &status, WNOHANG)) > 0 )
  74. + while ( (pid = waitpid (-1, &status, WNOHANG)) > 0 )
  75. {
  76. sprintf (buf, "pid %d", pid);
  77. reportstatus (buf, status, 1);