commit 39c137709c9e29341b2c01717b44358fddbbe65d
parent fc35256099359b7df477b44fbe9dbfd32e759b0f
Author: leitner <leitner>
Date: Tue, 10 Jul 2001 20:21:42 +0000
oink
Diffstat:
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,7 +1,9 @@
all: minit msvc pidfilehack
-CFLAGS=-pipe -march=i386 -fomit-frame-pointer -Os -I../dietlibc/include
-#LDFLAGS=../dietlibc/start.o ../dietlibc/dietlibc.a
+#CFLAGS=-pipe -march=i386 -fomit-frame-pointer -Os -I../dietlibc/include
+CFLAGS=-pipe -fomit-frame-pointer -Os -I../dietlibc/include
+CROSS=arm-linux-
+LDFLAGS=../dietlibc/start.o ../dietlibc/dietlibc.a -lgcc-sf
minit: minit.o split.o openreadclose.o
gcc -g $(LDFLAGS) -o minit $^
@@ -13,9 +15,9 @@ msvc: msvc.o
gcc $(CFLAGS) -c $^
diet: minit.c split.o openreadclose.o
- gcc -nostdlib -o minit -pipe -Os -m386 -I../dietlibc/include minit.c split.c openreadclose.c ../dietlibc/start.o ../dietlibc/dietlibc.a
- gcc -nostdlib -o msvc -pipe -Os -m386 -I../dietlibc/include msvc.c ../dietlibc/start.o ../dietlibc/dietlibc.a
- gcc -nostdlib -o pidfilehack -pipe -Os -m386 -I../dietlibc/include pidfilehack.c ../dietlibc/start.o ../dietlibc/dietlibc.a
+ $(CROSS)gcc -nostdlib -o minit $(CFLAGS) minit.c split.c openreadclose.c $(LDFLAGS)
+ $(CROSS)gcc -nostdlib -o msvc $(CFLAGS) msvc.c $(LDFLAGS)
+ $(CROSS)gcc -nostdlib -o pidfilehack $(CFLAGS) pidfilehack.c $(LDFLAGS)
strip -R .note -R .comment minit msvc pidfilehack
diet2: minit.c split.o openreadclose.o
diff --git a/msvc.c b/msvc.c
@@ -2,6 +2,7 @@
#include <sys/file.h>
#include <signal.h>
#include <stdio.h>
+#include <string.h>
static int infd,outfd;
@@ -46,7 +47,8 @@ int setpid(char *service, pid_t pid) {
char *tmp;
int len;
buf[0]='P';
- tmp=buf+1+strncpy(buf+1,service,1400);
+ strncpy(buf+1,service,1400);
+ tmp+=strlen(buf);
tmp[fmt_ulong(tmp,pid)]=0;
write(infd,buf,strlen(buf));
len=read(outfd,buf,1500);