* updated maddy (0.7.1 -> 0.8.1), untested
[t2sde.git] / package / shells / kiss / compile.patch.dietlibc
blob777379136a4389b2053e2c52494b6649b878ac71
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3
4 # T2 SDE: package/.../kiss/compile.patch.dietlibc
5 # Copyright (C) 2004 - 2016 The T2 SDE Project
6 # Copyright (C) 1998 - 2004 ROCK Linux Project
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 ---
19 The dietlibc getcwd function does not (yet) support the GNU extension to
20 allocate the string on-the-fly. So we use some sub-optimal aolution and
21 additional checks. WAIT_ANY should also be added to the dietlibc ...
23   Rene Rebe <rene@exactcode.de>
25 diff -ur kiss-0.21/src/getprompt.c src.kiss.-1.25906.3396530713/kiss-0.21/src/getprompt.c
26 --- kiss-0.21/src/getprompt.c   1998-09-25 14:07:10.000000000 +0200
27 +++ kiss-0.21/src/getprompt.c   2003-08-18 02:12:51.000000000 +0200
28 @@ -3,14 +3,14 @@
29  char *getprompt ()
30  {
31      register char
32 -       *prompt,
33 -       *cwd;
34 +       *prompt;
35      static char
36 -       buf [LINELEN];
37 +       buf [LINELEN],
38 +       cwd [LINELEN];
39      char
40         twobuf [2] = { 0, 0 };
42 -    cwd = getcwd (NULL, 0);
43 +    getcwd (cwd, LINELEN);
44      if (! flags.noenviron)
45         addtoenv ("PWD", cwd);
47 @@ -33,22 +33,22 @@
48                     strcat (buf, username);
49                     break;
50                 case 'p':
51 -                   strcat (buf, cwd);
52 +                   if (cwd)
53 +                       strcat (buf, cwd);
54                     break;
55                 default:
56 -                   twobuf [0] = *prompt;
57 -                   strcat (buf, twobuf);
58 +                   strcat (buf, prompt);
59             }
60         }
61         else
62         {
63 -           twobuf [0] = *prompt;
64 +           twobuf [0] = *prompt;
65             strcat (buf, twobuf);
66         }
67         prompt++;
68      }
69      
70 -    free (cwd);
71 +    /*free (cwd);*/
73      return (buf);
74  }
75 diff -ur kiss-0.21/src/waitforchild.c src.kiss.-1.25906.3396530713/kiss-0.21/src/waitforchild.c
76 --- kiss-0.21/src/waitforchild.c        1998-09-25 14:07:10.000000000 +0200
77 +++ kiss-0.21/src/waitforchild.c        2003-08-17 23:16:10.000000000 +0200
78 @@ -31,7 +31,7 @@
79         reportstatus (childname, status, background);
80      
81      /* let's see how generic kids are doing */
82 -    while ( (pid = waitpid (WAIT_ANY, &status, WNOHANG)) > 0 )
83 +    while ( (pid = waitpid (-1, &status, WNOHANG)) > 0 )
84      {
85         sprintf (buf, "pid %d", pid);
86         reportstatus (buf, status, 1);