Don't write to a temporary file to find version

This commit is contained in:
Brandon Skari 2016-02-24 18:54:26 -07:00
parent 64ca1afd85
commit 58b5585dc2
2 changed files with 5 additions and 11 deletions

View File

@ -6,19 +6,12 @@
char InitDma(void *FunctionTerminate)
{
DMA_CHANNEL=4;
if (system("rm -f linuxversion.txt") != 0) {
fprintf(stderr, "rm failed\n");
}
if (system("uname -r >> linuxversion.txt") != 0) {
fprintf(stderr, "uname failed\n");
}
char *line = NULL;
size_t size;
// int fLinux=open("Flinuxversion.txt", "r');
FILE * flinux=fopen("linuxversion.txt", "r");
if (getline(&line, &size, flinux) == -1)
FILE * flinux = popen("uname -r", "r");
if (flinux != NULL && getline(&line, &size, flinux) == -1)
{
printf("Could no get Linux version\n");
fprintf(stderr, "Could no get Linux version\n");
}
else
{
@ -35,6 +28,7 @@ char InitDma(void *FunctionTerminate)
}
}
pclose(flinux);
//printf("Init DMA\n");
// Catch all signals possible - it is vital we kill the DMA engine

View File

@ -173,7 +173,7 @@ terminate(int dummy)
{
stop_dma();
//munmap(virtbase,NUM_PAGES * PAGE_SIZE);
printf("END OF PiTx\n");
printf("END OF PiTx\n", dummy);
exit(1);
}