mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 02:27:26 -07:00
style
This commit is contained in:
parent
0442e04e05
commit
026cd7d53d
7 changed files with 40 additions and 41 deletions
|
@ -23,7 +23,7 @@ int main(int argc, char *argv[]) {
|
|||
// child
|
||||
if (pid == 0) {
|
||||
printf("[INFO] inside child\n");
|
||||
|
||||
|
||||
// Redirect stdout to the write end of the pipe
|
||||
dup2(pipefd[1], STDOUT_FILENO);
|
||||
|
||||
|
@ -39,13 +39,13 @@ int main(int argc, char *argv[]) {
|
|||
pm3_close(p);
|
||||
_exit(-1);
|
||||
} else {
|
||||
|
||||
|
||||
printf("[INFO] inside parent\n");
|
||||
// Parent: close write end of the pipe
|
||||
close(pipefd[1]);
|
||||
|
||||
|
||||
// Read from the pipe
|
||||
while (1) {
|
||||
while (1) {
|
||||
n = read(pipefd[0], buf, sizeof(buf));
|
||||
if (n == -1) {
|
||||
continue;
|
||||
|
@ -63,5 +63,5 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
// Close read end
|
||||
close(pipefd[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue