Skip to content
Snippets Groups Projects
Commit 4ac93780 authored by Chris's avatar Chris
Browse files

bugfixing

parent fd6f273c
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ void read_cpu_temp() {
//write pipe
const char *pOne = "/tmp/pipeOne";
int vOne = open(pOne, O_WRONLY);//todo: | O_NONBLOCK
int vOne = open(pOne, O_WRONLY O_NONBLOCK);//todo: | O_NONBLOCK
if (vOne == -1){
perror("Failed to open pipe one in read_cpu_temp");
return;
......@@ -44,7 +44,7 @@ void read_cpu_frequency() {
char *freq_path = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq";
file = fopen(freq_path, "r");
if (file == NULL) {b
if (file == NULL) {
printf("Error opening file\n");
return;
}
......@@ -67,7 +67,7 @@ int main(void) {
read_cpu_frequency();
//read pipes
int vOne = open(pOne, O_RDONLY);//todo: | O_NONBLOCK
int vOne = open(pOne, O_RDONLY | O_NONBLOCK);//todo: | O_NONBLOCK
if (vOne == -1) {
perror("Failed to open pipe one in main");
return 1;
......@@ -75,7 +75,7 @@ int main(void) {
char mOne[1024] = {}; //for now only sending char with the pipe
read(vOne, mOne, sizeof(mOne));
printf("value one received: %s\n", mOne);
close(vOne); //testing commit
close(vOne);
return 0;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment