* updated ktuberling (21.12.1 -> 21.12.2), untested
[t2-trunk.git] / package / base / fgetty / x-de-diet-fication.patch
blob30a6f6ea1170051185713630edfdc359f95f7ed3
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../fgetty/x-de-diet-fication.patch
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 Fixed fgetty to build witout dietlibc.
19 - Rene Rebe <rene@exactcode.de>
21 --- ./fgetty.c.vanilla 2005-02-27 11:30:39.580133784 +0100
22 +++ ./fgetty.c 2005-02-27 11:31:37.798283280 +0100
23 @@ -10,6 +10,7 @@
24 #include <sys/ioctl.h>
25 #include <errno.h>
26 #include <termios.h>
27 +#include <time.h>
29 #include "fmt.h"
31 --- ./login.c.vanilla 2005-02-27 11:33:30.557141328 +0100
32 +++ ./login.c 2005-02-27 11:33:41.628458232 +0100
33 @@ -36,6 +36,8 @@
34 #include <fcntl.h>
35 #include <signal.h>
37 +extern char **environ;
39 void die(const char *message) {
40 write(2,message,strlen(message));
41 write(2,"\n",1);
42 --- ./ltostr.c.vanilla 2005-02-27 11:37:07.164212048 +0100
43 +++ ./ltostr.c 2005-02-27 11:37:38.768407480 +0100
44 @@ -0,0 +1,36 @@
45 +#include <string.h>
46 +#include <stdlib.h>
48 +#ifndef __dietlibc__
50 +int __ltostr(char *s, unsigned int size, unsigned long i, unsigned int base, int UpCase)
52 + char *tmp;
53 + unsigned int j=0;
55 + s[--size]=0;
57 + tmp=s+size;
59 + if ((base==0)||(base>36)) base=10;
61 + j=0;
62 + if (!i)
63 + {
64 + *(--tmp)='0';
65 + j=1;
66 + }
68 + while((tmp>s)&&(i))
69 + {
70 + tmp--;
71 + if ((*tmp=i%base+'0')>'9') *tmp+=(UpCase?'A':'a')-'9'-1;
72 + i=i/base;
73 + j++;
74 + }
75 + memmove(s,tmp,j+1);
77 + return j;
80 +#endif
81 --- ./Makefile.vanilla 2005-02-27 11:32:44.925078456 +0100
82 +++ ./Makefile 2005-02-27 11:42:09.696220192 +0100
83 @@ -9,7 +9,7 @@
84 STRIP=strip
85 #CROSS=arm-linux-
86 CROSS=
87 -LDFLAGS=-s
88 +LDFLAGS=-s -lcrypt
90 %.o: %.c
91 # gcc -march=i386 -mcpu=i386 -pipe -Os -fomit-frame-pointer -I../dietlibc/include -c $^ -DTEST
92 @@ -18,11 +18,11 @@
93 $(CROSS)$(STRIP) -x -R .comment -R .note $@
95 %: %.o
96 - $(DIET) $(CROSS)$(CC) -nostdlib -o $@ $^ $(LDFLAGS)
97 + $(DIET) $(CROSS)$(CC) -o $@ $^ $(LDFLAGS)
99 fgetty: fgetty.o fmt_ulong.o
101 -login: login.o
102 +login: login.o ltostr.o
103 login2: login2.o
104 checkpassword: checkpassword.o