mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-06-28 16:15:34 +02:00
fixups
This commit is contained in:
parent
0c2894eabf
commit
a9c09e4d7d
3 changed files with 138 additions and 0 deletions
24
tools/sysvpatch.c
Normal file
24
tools/sysvpatch.c
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
int main(int argc, char *argv[]) {
|
||||
char s[BUFSIZ];
|
||||
snprintf(s, sizeof s, "strip %s", argv[1]);
|
||||
system(s);
|
||||
struct stat st;
|
||||
int fd = open(argv[1], O_RDONLY);
|
||||
if (fd) {
|
||||
fstat(fd, &st);
|
||||
char *buf = malloc(st.st_size);
|
||||
write(fd, buf, st.st_size);
|
||||
close(fd);
|
||||
/* set elf type to 0 = SYSV */
|
||||
buf[7] = 0;
|
||||
write(fileno(stdout), buf, st.st_size);
|
||||
free(buf);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue